| 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 #include "chrome/browser/printing/print_dialog_cloud_internal.h" | 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" |
| 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/prefs/pref_service.h" | 14 #include "base/prefs/pref_service.h" |
| 15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 16 #include "base/values.h" | 16 #include "base/values.h" |
| 17 #include "chrome/browser/devtools/devtools_window.h" | 17 #include "chrome/browser/devtools/devtools_window.h" |
| 18 #include "chrome/browser/lifetime/application_lifetime.h" | 18 #include "chrome/browser/lifetime/application_lifetime.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/printing/print_dialog_cloud_internal.h" |
| 20 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
| 21 #include "chrome/browser/profiles/profile_manager.h" | 22 #include "chrome/browser/profiles/profile_manager.h" |
| 22 #include "chrome/browser/ui/browser_dialogs.h" | 23 #include "chrome/browser/ui/browser_dialogs.h" |
| 23 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
| 24 #include "chrome/common/pref_names.h" | 25 #include "chrome/common/pref_names.h" |
| 25 #include "chrome/common/print_messages.h" | 26 #include "chrome/common/print_messages.h" |
| 26 #include "chrome/common/url_constants.h" | 27 #include "chrome/common/url_constants.h" |
| 27 #include "components/user_prefs/pref_registry_syncable.h" | 28 #include "components/user_prefs/pref_registry_syncable.h" |
| 28 #include "content/public/browser/browser_thread.h" | 29 #include "content/public/browser/browser_thread.h" |
| 29 #include "content/public/browser/navigation_controller.h" | 30 #include "content/public/browser/navigation_controller.h" |
| (...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 browser_context, modal_parent, data, print_job_title, | 683 browser_context, modal_parent, data, print_job_title, |
| 683 print_ticket, file_type)); | 684 print_ticket, file_type)); |
| 684 if (delete_on_close) | 685 if (delete_on_close) |
| 685 file_util::Delete(path_to_file, false); | 686 file_util::Delete(path_to_file, false); |
| 686 } | 687 } |
| 687 | 688 |
| 688 } // namespace internal_cloud_print_helpers | 689 } // namespace internal_cloud_print_helpers |
| 689 | 690 |
| 690 namespace print_dialog_cloud { | 691 namespace print_dialog_cloud { |
| 691 | 692 |
| 692 void RegisterUserPrefs(PrefRegistrySyncable* registry) { | 693 void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry) { |
| 693 registry->RegisterIntegerPref( | 694 registry->RegisterIntegerPref( |
| 694 prefs::kCloudPrintDialogWidth, | 695 prefs::kCloudPrintDialogWidth, |
| 695 kDefaultWidth, | 696 kDefaultWidth, |
| 696 PrefRegistrySyncable::UNSYNCABLE_PREF); | 697 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 697 registry->RegisterIntegerPref( | 698 registry->RegisterIntegerPref( |
| 698 prefs::kCloudPrintDialogHeight, | 699 prefs::kCloudPrintDialogHeight, |
| 699 kDefaultHeight, | 700 kDefaultHeight, |
| 700 PrefRegistrySyncable::UNSYNCABLE_PREF); | 701 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 701 } | 702 } |
| 702 | 703 |
| 703 // Called on the FILE or UI thread. This is the main entry point into creating | 704 // Called on the FILE or UI thread. This is the main entry point into creating |
| 704 // the dialog. | 705 // the dialog. |
| 705 | 706 |
| 706 void CreatePrintDialogForFile(content::BrowserContext* browser_context, | 707 void CreatePrintDialogForFile(content::BrowserContext* browser_context, |
| 707 gfx::NativeWindow modal_parent, | 708 gfx::NativeWindow modal_parent, |
| 708 const base::FilePath& path_to_file, | 709 const base::FilePath& path_to_file, |
| 709 const string16& print_job_title, | 710 const string16& print_job_title, |
| 710 const string16& print_ticket, | 711 const string16& print_ticket, |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 print_job_print_ticket, | 779 print_job_print_ticket, |
| 779 file_type, | 780 file_type, |
| 780 delete_on_close); | 781 delete_on_close); |
| 781 return true; | 782 return true; |
| 782 } | 783 } |
| 783 } | 784 } |
| 784 return false; | 785 return false; |
| 785 } | 786 } |
| 786 | 787 |
| 787 } // end namespace | 788 } // end namespace |
| OLD | NEW |