| 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()));
|
|
|