| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 const content::LoadCommittedDetails& details, | 144 const content::LoadCommittedDetails& details, |
| 145 const content::FrameNavigateParams& params) OVERRIDE { | 145 const content::FrameNavigateParams& params) OVERRIDE { |
| 146 if (IsSimilarUrl(params.url, cloud_print_url_)) { | 146 if (IsSimilarUrl(params.url, cloud_print_url_)) { |
| 147 base::MessageLoop::current()->PostTask( | 147 base::MessageLoop::current()->PostTask( |
| 148 FROM_HERE, | 148 FROM_HERE, |
| 149 base::Bind(&SignInObserver::OnSignIn, | 149 base::Bind(&SignInObserver::OnSignIn, |
| 150 weak_ptr_factory_.GetWeakPtr())); | 150 weak_ptr_factory_.GetWeakPtr())); |
| 151 } | 151 } |
| 152 } | 152 } |
| 153 | 153 |
| 154 virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE { | 154 virtual void WebContentsDestroyed() OVERRIDE { |
| 155 delete this; | 155 delete this; |
| 156 } | 156 } |
| 157 | 157 |
| 158 void OnSignIn() { | 158 void OnSignIn() { |
| 159 callback_.Run(); | 159 callback_.Run(); |
| 160 if (web_contents()) | 160 if (web_contents()) |
| 161 web_contents()->Close(); | 161 web_contents()->Close(); |
| 162 } | 162 } |
| 163 | 163 |
| 164 GURL cloud_print_url_; | 164 GURL cloud_print_url_; |
| (...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 | 761 |
| 762 print_dialog_cloud::CreatePrintDialogForFile(profile, NULL, | 762 print_dialog_cloud::CreatePrintDialogForFile(profile, NULL, |
| 763 cloud_print_file, print_job_title, print_job_print_ticket, file_type); | 763 cloud_print_file, print_job_title, print_job_print_ticket, file_type); |
| 764 return true; | 764 return true; |
| 765 } | 765 } |
| 766 } | 766 } |
| 767 return false; | 767 return false; |
| 768 } | 768 } |
| 769 | 769 |
| 770 } // namespace print_dialog_cloud | 770 } // namespace print_dialog_cloud |
| OLD | NEW |