| 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/printing/print_dialog_cloud.h" | 5 #include "chrome/browser/printing/print_dialog_cloud.h" |
| 6 #include "chrome/browser/printing/print_dialog_cloud_internal.h" | 6 #include "chrome/browser/printing/print_dialog_cloud_internal.h" |
| 7 | 7 |
| 8 #include "base/base64.h" | 8 #include "base/base64.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "chrome/browser/browser_list.h" | 12 #include "chrome/browser/browser_list.h" |
| 13 #include "chrome/browser/browser_thread.h" | 13 #include "chrome/browser/browser_thread.h" |
| 14 #include "chrome/browser/debugger/devtools_manager.h" | 14 #include "chrome/browser/debugger/devtools_manager.h" |
| 15 #include "chrome/browser/prefs/pref_service.h" | 15 #include "chrome/browser/prefs/pref_service.h" |
| 16 #include "chrome/browser/printing/cloud_print/cloud_print_url.h" | 16 #include "chrome/browser/printing/cloud_print/cloud_print_url.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
| 18 #include "chrome/browser/profiles/profile_manager.h" | 18 #include "chrome/browser/profiles/profile_manager.h" |
| 19 #include "chrome/browser/renderer_host/render_view_host.h" | 19 #include "chrome/browser/renderer_host/render_view_host.h" |
| 20 #include "chrome/browser/tab_contents/tab_contents.h" | 20 #include "chrome/browser/tab_contents/tab_contents.h" |
| 21 #include "chrome/browser/tab_contents/tab_contents_view.h" | 21 #include "chrome/browser/tab_contents/tab_contents_view.h" |
| 22 #include "chrome/browser/ui/browser_dialogs.h" | 22 #include "chrome/browser/ui/browser_dialogs.h" |
| 23 #include "chrome/browser/webui/web_ui.h" | |
| 24 #include "chrome/browser/webui/web_ui_util.h" | |
| 25 #include "chrome/common/notification_registrar.h" | 23 #include "chrome/common/notification_registrar.h" |
| 26 #include "chrome/common/notification_source.h" | 24 #include "chrome/common/notification_source.h" |
| 27 #include "chrome/common/notification_type.h" | 25 #include "chrome/common/notification_type.h" |
| 28 #include "chrome/common/pref_names.h" | 26 #include "chrome/common/pref_names.h" |
| 29 #include "chrome/common/render_messages_params.h" | 27 #include "chrome/common/render_messages_params.h" |
| 30 #include "chrome/common/url_constants.h" | 28 #include "chrome/common/url_constants.h" |
| 29 #include "content/browser/webui/web_ui.h" |
| 30 #include "content/browser/webui/web_ui_util.h" |
| 31 #include "ui/base/l10n/l10n_util.h" | 31 #include "ui/base/l10n/l10n_util.h" |
| 32 #include "webkit/glue/webpreferences.h" | 32 #include "webkit/glue/webpreferences.h" |
| 33 | 33 |
| 34 #include "grit/generated_resources.h" | 34 #include "grit/generated_resources.h" |
| 35 | 35 |
| 36 // This module implements the UI support in Chrome for cloud printing. | 36 // This module implements the UI support in Chrome for cloud printing. |
| 37 // This means hosting a dialog containing HTML/JavaScript and using | 37 // This means hosting a dialog containing HTML/JavaScript and using |
| 38 // the published cloud print user interface integration APIs to get | 38 // the published cloud print user interface integration APIs to get |
| 39 // page setup settings from the dialog contents and provide the | 39 // page setup settings from the dialog contents and provide the |
| 40 // generated print PDF to the dialog contents for uploading to the | 40 // generated print PDF to the dialog contents for uploading to the |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 HtmlDialogUIDelegate* dialog_delegate = | 567 HtmlDialogUIDelegate* dialog_delegate = |
| 568 new internal_cloud_print_helpers::CloudPrintHtmlDialogDelegate( | 568 new internal_cloud_print_helpers::CloudPrintHtmlDialogDelegate( |
| 569 path_to_pdf, width, height, std::string(), job_title, modal); | 569 path_to_pdf, width, height, std::string(), job_title, modal); |
| 570 if (modal) { | 570 if (modal) { |
| 571 DCHECK(browser_); | 571 DCHECK(browser_); |
| 572 browser_->BrowserShowHtmlDialog(dialog_delegate, NULL); | 572 browser_->BrowserShowHtmlDialog(dialog_delegate, NULL); |
| 573 } else { | 573 } else { |
| 574 browser::ShowHtmlDialog(NULL, profile, dialog_delegate); | 574 browser::ShowHtmlDialog(NULL, profile, dialog_delegate); |
| 575 } | 575 } |
| 576 } | 576 } |
| OLD | NEW |