Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_UTILITY_PROFILE_IMPORT_HANDLER_H_ | |
| 6 #define CHROME_UTILITY_PROFILE_IMPORT_HANDLER_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 #include "base/memory/ref_counted.h" | |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "ipc/ipc_listener.h" | |
| 12 | |
| 13 class ExternalProcessImporterBridge; | |
| 14 class Importer; | |
| 15 | |
| 16 namespace base { | |
| 17 class DictionaryValue; | |
| 18 class Thread; | |
| 19 } | |
| 20 | |
| 21 namespace importer { | |
| 22 struct SourceProfile; | |
| 23 } | |
| 24 | |
| 25 namespace IPC { | |
| 26 class Message; | |
| 27 } | |
| 28 | |
| 29 namespace chrome { | |
| 30 | |
| 31 class ProfileImportHandler : public IPC::Listener { | |
|
Yaron
2012/07/18 15:30:39
Brief class comment
Philippe
2012/07/18 16:01:17
Done.
| |
| 32 public: | |
| 33 ProfileImportHandler(); | |
| 34 ~ProfileImportHandler(); | |
| 35 | |
| 36 // IPC::Listener: | |
| 37 virtual bool OnMessageReceived(const IPC::Message& message); | |
| 38 | |
| 39 private: | |
| 40 void OnImportStart( | |
| 41 const importer::SourceProfile& source_profile, | |
| 42 uint16 items, | |
| 43 const base::DictionaryValue& localized_strings); | |
| 44 | |
| 45 void OnImportCancel() { | |
| 46 ImporterCleanup(); | |
|
Yaron
2012/07/18 15:30:39
move to cc file
Philippe
2012/07/18 16:01:17
Done.
| |
| 47 } | |
| 48 | |
| 49 // The following are used with out of process profile import: | |
| 50 void ImporterCleanup(); | |
| 51 | |
| 52 void OnImportItemFinished(uint16 item); | |
| 53 | |
| 54 static bool Send(IPC::Message* message); | |
| 55 | |
| 56 // Thread that importer runs on, while ProfileImportThread handles messages | |
| 57 // from the browser process. | |
| 58 scoped_ptr<base::Thread> import_thread_; | |
| 59 | |
| 60 // Bridge object is passed to importer, so that it can send IPC calls | |
| 61 // directly back to the ProfileImportProcessHost. | |
| 62 scoped_refptr<ExternalProcessImporterBridge> bridge_; | |
| 63 | |
| 64 // A bitmask of importer::ImportItem. | |
| 65 uint16 items_to_import_; | |
| 66 | |
| 67 // Importer of the appropriate type (Firefox, Safari, IE, etc.) | |
| 68 scoped_refptr<Importer> importer_; | |
| 69 }; | |
| 70 | |
| 71 } // namespace chrome | |
| 72 | |
| 73 #endif // CHROME_UTILITY_PROFILE_IMPORT_HANDLER_H_ | |
| OLD | NEW |