| 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 #ifndef CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ | 5 #ifndef CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ |
| 6 #define CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ | 6 #define CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/ref_counted.h" | |
| 10 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
| 12 #include "content/public/utility/content_utility_client.h" | 11 #include "content/public/utility/content_utility_client.h" |
| 13 #include "printing/pdf_render_settings.h" | 12 #include "printing/pdf_render_settings.h" |
| 14 | 13 |
| 15 class ExternalProcessImporterBridge; | 14 class ExternalProcessImporterBridge; |
| 16 class FilePath; | 15 class FilePath; |
| 17 class Importer; | 16 class Importer; |
| 18 | 17 |
| 19 namespace base { | 18 namespace base { |
| 20 class DictionaryValue; | 19 class DictionaryValue; |
| 21 class Thread; | 20 class Thread; |
| 22 } | 21 } |
| 23 | 22 |
| 24 namespace gfx { | 23 namespace gfx { |
| 25 class Rect; | 24 class Rect; |
| 26 } | 25 } |
| 27 | 26 |
| 28 namespace importer { | 27 namespace importer { |
| 29 struct SourceProfile; | 28 struct SourceProfile; |
| 30 } | 29 } |
| 31 | 30 |
| 32 namespace printing { | 31 namespace printing { |
| 33 struct PageRange; | 32 struct PageRange; |
| 34 } | 33 } |
| 35 | 34 |
| 36 namespace chrome { | 35 namespace chrome { |
| 37 | 36 |
| 37 class ProfileImportHandler; |
| 38 |
| 38 class ChromeContentUtilityClient : public content::ContentUtilityClient { | 39 class ChromeContentUtilityClient : public content::ContentUtilityClient { |
| 39 public: | 40 public: |
| 40 ChromeContentUtilityClient(); | 41 ChromeContentUtilityClient(); |
| 41 ~ChromeContentUtilityClient(); | 42 ~ChromeContentUtilityClient(); |
| 42 | 43 |
| 43 virtual void UtilityThreadStarted() OVERRIDE; | 44 virtual void UtilityThreadStarted() OVERRIDE; |
| 44 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 45 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 45 | 46 |
| 46 private: | 47 private: |
| 47 virtual bool Send(IPC::Message* message); | 48 virtual bool Send(IPC::Message* message); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 70 const gfx::Rect& render_area, | 71 const gfx::Rect& render_area, |
| 71 int render_dpi, | 72 int render_dpi, |
| 72 bool autorotate, | 73 bool autorotate, |
| 73 const std::vector<printing::PageRange>& page_ranges, | 74 const std::vector<printing::PageRange>& page_ranges, |
| 74 int* highest_rendered_page_number, | 75 int* highest_rendered_page_number, |
| 75 double* scale_factor); | 76 double* scale_factor); |
| 76 #endif // defined(OS_WIN) | 77 #endif // defined(OS_WIN) |
| 77 | 78 |
| 78 void OnGetPrinterCapsAndDefaults(const std::string& printer_name); | 79 void OnGetPrinterCapsAndDefaults(const std::string& printer_name); |
| 79 | 80 |
| 80 void OnImportStart( | 81 scoped_ptr<ProfileImportHandler> import_handler_; |
| 81 const importer::SourceProfile& source_profile, | |
| 82 uint16 items, | |
| 83 const base::DictionaryValue& localized_strings); | |
| 84 void OnImportCancel(); | |
| 85 void OnImportItemFinished(uint16 item); | |
| 86 | |
| 87 // The following are used with out of process profile import: | |
| 88 void ImporterCleanup(); | |
| 89 | |
| 90 // Thread that importer runs on, while ProfileImportThread handles messages | |
| 91 // from the browser process. | |
| 92 scoped_ptr<base::Thread> import_thread_; | |
| 93 | |
| 94 // Bridge object is passed to importer, so that it can send IPC calls | |
| 95 // directly back to the ProfileImportProcessHost. | |
| 96 scoped_refptr<ExternalProcessImporterBridge> bridge_; | |
| 97 | |
| 98 // A bitmask of importer::ImportItem. | |
| 99 uint16 items_to_import_; | |
| 100 | |
| 101 // Importer of the appropriate type (Firefox, Safari, IE, etc.) | |
| 102 scoped_refptr<Importer> importer_; | |
| 103 }; | 82 }; |
| 104 | 83 |
| 105 } // namespace chrome | 84 } // namespace chrome |
| 106 | 85 |
| 107 #endif // CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ | 86 #endif // CHROME_UTILITY_CHROME_CONTENT_UTILITY_CLIENT_H_ |
| OLD | NEW |