OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/printing/print_dialog_cloud.h" | 5 #include "chrome/browser/printing/print_dialog_cloud.h" |
6 | 6 |
7 | 7 |
8 #include "base/base64.h" | 8 #include "base/base64.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 : WebContentsObserver(web_contents), | 138 : WebContentsObserver(web_contents), |
139 cloud_print_url_(cloud_print_url), | 139 cloud_print_url_(cloud_print_url), |
140 callback_(callback), | 140 callback_(callback), |
141 weak_ptr_factory_(this) { | 141 weak_ptr_factory_(this) { |
142 } | 142 } |
143 | 143 |
144 private: | 144 private: |
145 // Overridden from content::WebContentsObserver: | 145 // Overridden from content::WebContentsObserver: |
146 virtual void DidNavigateMainFrame( | 146 virtual void DidNavigateMainFrame( |
147 const content::LoadCommittedDetails& details, | 147 const content::LoadCommittedDetails& details, |
148 const content::FrameNavigateParams& params) OVERRIDE { | 148 const content::FrameNavigateParams& params) override { |
149 if (IsSimilarUrl(params.url, cloud_print_url_)) { | 149 if (IsSimilarUrl(params.url, cloud_print_url_)) { |
150 base::MessageLoop::current()->PostTask( | 150 base::MessageLoop::current()->PostTask( |
151 FROM_HERE, | 151 FROM_HERE, |
152 base::Bind(&SignInObserver::OnSignIn, | 152 base::Bind(&SignInObserver::OnSignIn, |
153 weak_ptr_factory_.GetWeakPtr())); | 153 weak_ptr_factory_.GetWeakPtr())); |
154 } | 154 } |
155 } | 155 } |
156 | 156 |
157 virtual void WebContentsDestroyed() OVERRIDE { | 157 virtual void WebContentsDestroyed() override { |
158 delete this; | 158 delete this; |
159 } | 159 } |
160 | 160 |
161 void OnSignIn() { | 161 void OnSignIn() { |
162 callback_.Run(); | 162 callback_.Run(); |
163 if (web_contents()) | 163 if (web_contents()) |
164 web_contents()->Close(); | 164 web_contents()->Close(); |
165 } | 165 } |
166 | 166 |
167 GURL cloud_print_url_; | 167 GURL cloud_print_url_; |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 | 777 |
778 print_dialog_cloud::CreatePrintDialogForFile(profile, NULL, | 778 print_dialog_cloud::CreatePrintDialogForFile(profile, NULL, |
779 cloud_print_file, print_job_title, print_job_print_ticket, file_type); | 779 cloud_print_file, print_job_title, print_job_print_ticket, file_type); |
780 return true; | 780 return true; |
781 } | 781 } |
782 } | 782 } |
783 return false; | 783 return false; |
784 } | 784 } |
785 | 785 |
786 } // namespace print_dialog_cloud | 786 } // namespace print_dialog_cloud |
OLD | NEW |