| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/webui/cloud_print_signin_dialog.h" | 5 #include "chrome/browser/ui/webui/cloud_print_signin_dialog.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "chrome/browser/prefs/pref_service.h" | 11 #include "chrome/browser/prefs/pref_service.h" |
| 12 #include "chrome/browser/printing/cloud_print/cloud_print_url.h" | 12 #include "chrome/browser/printing/cloud_print/cloud_print_url.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
| 15 #include "chrome/browser/ui/browser_list.h" | 15 #include "chrome/browser/ui/browser_list.h" |
| 16 #include "chrome/browser/ui/dialog_style.h" | 16 #include "chrome/browser/ui/dialog_style.h" |
| 17 #include "chrome/browser/ui/webui/html_dialog_ui.h" | 17 #include "chrome/browser/ui/webui/html_dialog_ui.h" |
| 18 #include "chrome/browser/ui/webui/print_preview_ui.h" | 18 #include "chrome/browser/ui/webui/print_preview_ui.h" |
| 19 #include "chrome/common/pref_names.h" | 19 #include "chrome/common/pref_names.h" |
| 20 #include "chrome/common/url_constants.h" | 20 #include "chrome/common/url_constants.h" |
| 21 #include "content/browser/renderer_host/render_view_host.h" | 21 #include "content/browser/renderer_host/render_view_host.h" |
| 22 #include "content/browser/tab_contents/navigation_controller.h" | 22 #include "content/browser/tab_contents/navigation_controller.h" |
| 23 #include "content/browser/tab_contents/tab_contents_view.h" | 23 #include "content/browser/tab_contents/tab_contents_view.h" |
| 24 #include "content/public/browser/navigation_entry.h" | 24 #include "content/public/browser/navigation_entry.h" |
| 25 #include "content/public/browser/notification_registrar.h" | 25 #include "content/public/browser/notification_registrar.h" |
| 26 #include "content/public/browser/notification_source.h" | 26 #include "content/public/browser/notification_source.h" |
| 27 #include "content/public/browser/notification_types.h" | 27 #include "content/public/browser/notification_types.h" |
| 28 #include "content/public/browser/web_contents.h" | 28 #include "content/public/browser/web_contents.h" |
| 29 #include "content/public/browser/web_ui_message_handler.h" |
| 29 | 30 |
| 30 using content::BrowserThread; | 31 using content::BrowserThread; |
| 31 using content::NavigationEntry; | 32 using content::NavigationEntry; |
| 32 using content::WebContents; | 33 using content::WebContents; |
| 34 using content::WebUIMessageHandler; |
| 33 | 35 |
| 34 // This module implements a sign in dialog for cloud print. | 36 // This module implements a sign in dialog for cloud print. |
| 35 // it is based heavily off "chrome/browser/printing/print_dialog_cloud.cc". | 37 // it is based heavily off "chrome/browser/printing/print_dialog_cloud.cc". |
| 36 // See the comments in that file for a discussion about how this works. | 38 // See the comments in that file for a discussion about how this works. |
| 37 | 39 |
| 38 namespace cloud_print_signin_dialog { | 40 namespace cloud_print_signin_dialog { |
| 39 | 41 |
| 40 // The flow handler sends our dialog to the correct URL, saves size info, | 42 // The flow handler sends our dialog to the correct URL, saves size info, |
| 41 // and closes the dialog when sign in is complete. | 43 // and closes the dialog when sign in is complete. |
| 42 class CloudPrintSigninFlowHandler : public WebUIMessageHandler, | 44 class CloudPrintSigninFlowHandler : public WebUIMessageHandler, |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 } | 195 } |
| 194 | 196 |
| 195 void CreateCloudPrintSigninDialog(WebContents* parent_tab) { | 197 void CreateCloudPrintSigninDialog(WebContents* parent_tab) { |
| 196 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 198 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 197 | 199 |
| 198 BrowserThread::PostTask( | 200 BrowserThread::PostTask( |
| 199 BrowserThread::UI, FROM_HERE, | 201 BrowserThread::UI, FROM_HERE, |
| 200 base::Bind(&CreateCloudPrintSigninDialogImpl, parent_tab)); | 202 base::Bind(&CreateCloudPrintSigninDialogImpl, parent_tab)); |
| 201 } | 203 } |
| 202 } // namespace cloud_print_signin_dialog | 204 } // namespace cloud_print_signin_dialog |
| OLD | NEW |