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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
13 #include "base/json/json_reader.h" | 13 #include "base/json/json_reader.h" |
14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
15 #include "base/values.h" | 15 #include "base/values.h" |
16 #include "chrome/browser/browser_process_impl.h" | 16 #include "chrome/browser/browser_process_impl.h" |
17 #include "chrome/browser/debugger/devtools_window.h" | 17 #include "chrome/browser/debugger/devtools_window.h" |
18 #include "chrome/browser/prefs/pref_service.h" | 18 #include "chrome/browser/prefs/pref_service.h" |
19 #include "chrome/browser/printing/cloud_print/cloud_print_url.h" | 19 #include "chrome/browser/printing/cloud_print/cloud_print_url.h" |
20 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
21 #include "chrome/browser/profiles/profile_manager.h" | 21 #include "chrome/browser/profiles/profile_manager.h" |
22 #include "chrome/browser/ui/browser_dialogs.h" | 22 #include "chrome/browser/ui/browser_dialogs.h" |
23 #include "chrome/browser/ui/browser_list.h" | 23 #include "chrome/browser/ui/browser_list.h" |
| 24 #include "chrome/browser/ui/dialog_style.h" |
24 #include "chrome/common/chrome_switches.h" | 25 #include "chrome/common/chrome_switches.h" |
25 #include "chrome/common/pref_names.h" | 26 #include "chrome/common/pref_names.h" |
26 #include "chrome/common/print_messages.h" | 27 #include "chrome/common/print_messages.h" |
27 #include "chrome/common/url_constants.h" | 28 #include "chrome/common/url_constants.h" |
28 #include "content/browser/renderer_host/render_view_host.h" | 29 #include "content/browser/renderer_host/render_view_host.h" |
29 #include "content/browser/tab_contents/tab_contents.h" | 30 #include "content/browser/tab_contents/tab_contents.h" |
30 #include "content/browser/tab_contents/tab_contents_view.h" | 31 #include "content/browser/tab_contents/tab_contents_view.h" |
31 #include "content/browser/webui/web_ui.h" | 32 #include "content/browser/webui/web_ui.h" |
32 #include "content/public/browser/browser_thread.h" | 33 #include "content/public/browser/browser_thread.h" |
33 #include "content/public/browser/notification_registrar.h" | 34 #include "content/public/browser/notification_registrar.h" |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 | 624 |
624 int width = pref_service->GetInteger(prefs::kCloudPrintDialogWidth); | 625 int width = pref_service->GetInteger(prefs::kCloudPrintDialogWidth); |
625 int height = pref_service->GetInteger(prefs::kCloudPrintDialogHeight); | 626 int height = pref_service->GetInteger(prefs::kCloudPrintDialogHeight); |
626 | 627 |
627 HtmlDialogUIDelegate* dialog_delegate = | 628 HtmlDialogUIDelegate* dialog_delegate = |
628 new internal_cloud_print_helpers::CloudPrintHtmlDialogDelegate( | 629 new internal_cloud_print_helpers::CloudPrintHtmlDialogDelegate( |
629 path_to_file, width, height, std::string(), job_title, print_ticket, | 630 path_to_file, width, height, std::string(), job_title, print_ticket, |
630 file_type, modal, delete_on_close); | 631 file_type, modal, delete_on_close); |
631 if (modal) { | 632 if (modal) { |
632 DCHECK(browser); | 633 DCHECK(browser); |
633 browser->BrowserShowHtmlDialog(dialog_delegate, NULL); | 634 browser->BrowserShowHtmlDialog(dialog_delegate, NULL, STYLE_GENERIC); |
634 } else { | 635 } else { |
635 browser::ShowHtmlDialog(NULL, profile, dialog_delegate); | 636 browser::ShowHtmlDialog(NULL, profile, dialog_delegate, STYLE_GENERIC); |
636 } | 637 } |
637 } | 638 } |
638 | 639 |
639 // Provides a runnable function to delete a file. | 640 // Provides a runnable function to delete a file. |
640 void Delete(const FilePath& file_path) { | 641 void Delete(const FilePath& file_path) { |
641 file_util::Delete(file_path, false); | 642 file_util::Delete(file_path, false); |
642 } | 643 } |
643 | 644 |
644 } // namespace internal_cloud_print_helpers | 645 } // namespace internal_cloud_print_helpers |
645 | 646 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 file_type, | 716 file_type, |
716 false, | 717 false, |
717 delete_on_close); | 718 delete_on_close); |
718 return true; | 719 return true; |
719 } | 720 } |
720 } | 721 } |
721 return false; | 722 return false; |
722 } | 723 } |
723 | 724 |
724 } // end namespace | 725 } // end namespace |
OLD | NEW |