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

Unified Diff: chrome/browser/printing/print_dialog_cloud.cc

Issue 2665303003: Convert print_dialog_cloud::SignInObserver to use the new navigation callbacks. (Closed)
Patch Set: 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/print_dialog_cloud.cc
diff --git a/chrome/browser/printing/print_dialog_cloud.cc b/chrome/browser/printing/print_dialog_cloud.cc
index 2491feff0b126c098a46b9507e09b99c66fd1be4..8fb8f9df5f0e45dcbc57de5d3f6d220ff318cff0 100644
--- a/chrome/browser/printing/print_dialog_cloud.cc
+++ b/chrome/browser/printing/print_dialog_cloud.cc
@@ -17,6 +17,7 @@
#include "components/signin/core/browser/signin_metrics.h"
#include "components/signin/core/common/profile_management_switches.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
@@ -35,10 +36,14 @@ class SignInObserver : public content::WebContentsObserver {
private:
// Overridden from content::WebContentsObserver:
- void DidNavigateMainFrame(
- const content::LoadCommittedDetails& details,
- const content::FrameNavigateParams& params) override {
- if (cloud_devices::IsCloudPrintURL(params.url)) {
+ void DidFinishNavigation(
+ content::NavigationHandle* navigation_handle) override {
+ if (!navigation_handle->IsInMainFrame() ||
+ !navigation_handle->HasCommitted()) {
+ return;
+ }
+
+ if (cloud_devices::IsCloudPrintURL(navigation_handle->GetURL())) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(&SignInObserver::OnSignIn,
weak_ptr_factory_.GetWeakPtr()));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698