Commit e4a57b1a authored by gogerald's avatar gogerald Committed by Commit Bot

[Payments] Display origin for initial loading and navigating

Baug: 840759
Change-Id: Ibade40328413f8dbd9a7518f7af692322d172b49
Reviewed-on: https://chromium-review.googlesource.com/1048982
Commit-Queue: Mathieu Perreault <mathp@chromium.org>
Reviewed-by: default avatarMathieu Perreault <mathp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557187}
parent a9cdd888
...@@ -194,8 +194,9 @@ bool PaymentHandlerWebFlowViewController::ShouldShowSecondaryButton() { ...@@ -194,8 +194,9 @@ bool PaymentHandlerWebFlowViewController::ShouldShowSecondaryButton() {
std::unique_ptr<views::View> std::unique_ptr<views::View>
PaymentHandlerWebFlowViewController::CreateHeaderContentView() { PaymentHandlerWebFlowViewController::CreateHeaderContentView() {
const GURL origin = const GURL origin = web_contents()
web_contents() ? web_contents()->GetVisibleURL().GetOrigin() : GURL(); ? web_contents()->GetVisibleURL().GetOrigin()
: target_.GetOrigin();
std::unique_ptr<views::Background> background = GetHeaderBackground(); std::unique_ptr<views::Background> background = GetHeaderBackground();
return std::make_unique<ReadOnlyOriginView>( return std::make_unique<ReadOnlyOriginView>(
GetSheetTitle(), origin, GetSheetTitle(), origin,
...@@ -224,6 +225,11 @@ void PaymentHandlerWebFlowViewController::ButtonPressed( ...@@ -224,6 +225,11 @@ void PaymentHandlerWebFlowViewController::ButtonPressed(
} }
} }
void PaymentHandlerWebFlowViewController::DidStartNavigation(
content::NavigationHandle* navigation_handle) {
UpdateHeaderView();
}
void PaymentHandlerWebFlowViewController::DidFinishNavigation( void PaymentHandlerWebFlowViewController::DidFinishNavigation(
content::NavigationHandle* navigation_handle) { content::NavigationHandle* navigation_handle) {
if (!OriginSecurityChecker::IsOriginSecure(navigation_handle->GetURL()) || if (!OriginSecurityChecker::IsOriginSecure(navigation_handle->GetURL()) ||
......
...@@ -48,6 +48,8 @@ class PaymentHandlerWebFlowViewController ...@@ -48,6 +48,8 @@ class PaymentHandlerWebFlowViewController
void ButtonPressed(views::Button* sender, const ui::Event& event) override; void ButtonPressed(views::Button* sender, const ui::Event& event) override;
// content::WebContentsObserver: // content::WebContentsObserver:
void DidStartNavigation(
content::NavigationHandle* navigation_handle) override;
void DidFinishNavigation( void DidFinishNavigation(
content::NavigationHandle* navigation_handle) override; content::NavigationHandle* navigation_handle) override;
void TitleWasSet(content::NavigationEntry* entry) override; void TitleWasSet(content::NavigationEntry* entry) override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment