Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4003)

Unified Diff: chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc

Issue 2659753002: Convert MobileSetupUI to use the new navigation callbacks. (Closed)
Patch Set: nit Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/chromeos/mobile_setup_ui.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc
diff --git a/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc b/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc
index 237cb793ffbdc6360ebbf6c1123477a8073f3aab..fcd76e36fe5083c340a8ca31c13453d7474ab55a 100644
--- a/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc
@@ -40,6 +40,7 @@
#include "chromeos/network/network_state_handler_observer.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/url_data_source.h"
#include "content/public/browser/web_contents.h"
@@ -628,26 +629,20 @@ MobileSetupUI::MobileSetupUI(content::WebUI* web_ui)
content::WebContentsObserver::Observe(web_ui->GetWebContents());
}
-void MobileSetupUI::DidCommitProvisionalLoadForFrame(
- content::RenderFrameHost* render_frame_host,
- const GURL& url,
- ui::PageTransition transition_type) {
- if (render_frame_host->GetFrameName() != "paymentForm")
+void MobileSetupUI::DidFinishNavigation(
+ content::NavigationHandle* navigation_handle) {
+ if (!navigation_handle->HasCommitted() ||
+ navigation_handle->GetRenderFrameHost()->GetFrameName() !=
+ "paymentForm") {
return;
+ }
- web_ui()->CallJavascriptFunctionUnsafe(kJsPortalFrameLoadCompletedCallback);
-}
-
-void MobileSetupUI::DidFailProvisionalLoad(
- content::RenderFrameHost* render_frame_host,
- const GURL& validated_url,
- int error_code,
- const base::string16& error_description,
- bool was_ignored_by_handler) {
- if (render_frame_host->GetFrameName() != "paymentForm")
+ if (navigation_handle->IsErrorPage()) {
+ base::FundamentalValue result_value(-navigation_handle->GetNetErrorCode());
+ web_ui()->CallJavascriptFunctionUnsafe(kJsPortalFrameLoadFailedCallback,
+ result_value);
return;
+ }
- base::FundamentalValue result_value(-error_code);
- web_ui()->CallJavascriptFunctionUnsafe(kJsPortalFrameLoadFailedCallback,
- result_value);
+ web_ui()->CallJavascriptFunctionUnsafe(kJsPortalFrameLoadCompletedCallback);
}
« no previous file with comments | « chrome/browser/ui/webui/chromeos/mobile_setup_ui.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698