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 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_IMPORT_DATA_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_IMPORT_DATA_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_IMPORT_DATA_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_IMPORT_DATA_HANDLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "chrome/browser/importer/importer_data_types.h" | 12 #include "chrome/browser/importer/importer_data_types.h" |
13 #include "chrome/browser/importer/importer_list.h" | 13 #include "chrome/browser/importer/importer_list.h" |
14 #include "chrome/browser/importer/importer_progress_observer.h" | 14 #include "chrome/browser/importer/importer_progress_observer.h" |
15 #include "chrome/browser/ui/webui/options/options_ui.h" | 15 #include "chrome/browser/ui/webui/options/options_ui.h" |
16 | 16 |
17 class ImporterHost; | 17 class ImporterHost; |
18 | 18 |
19 // Chrome personal stuff import data overlay UI handler. | 19 // Chrome personal stuff import data overlay UI handler. |
20 class ImportDataHandler : public OptionsPageUIHandler, | 20 class ImportDataHandler : public OptionsPageUIHandler, |
21 public ImporterList::Observer, | 21 public ImporterList::Observer, |
22 public importer::ImporterProgressObserver { | 22 public importer::ImporterProgressObserver { |
23 public: | 23 public: |
24 ImportDataHandler(); | 24 ImportDataHandler(); |
25 virtual ~ImportDataHandler(); | 25 virtual ~ImportDataHandler(); |
26 | 26 |
27 // OptionsPageUIHandler: | 27 // OptionsPageUIHandler: |
28 virtual void GetLocalizedValues(DictionaryValue* localized_strings); | 28 virtual void GetLocalizedValues(base::DictionaryValue* localized_strings); |
29 virtual void Initialize(); | 29 virtual void Initialize(); |
30 | 30 |
31 // WebUIMessageHandler: | 31 // WebUIMessageHandler: |
32 virtual void RegisterMessages(); | 32 virtual void RegisterMessages(); |
33 | 33 |
34 private: | 34 private: |
35 void ImportData(const ListValue* args); | 35 void ImportData(const base::ListValue* args); |
36 | 36 |
37 // ImporterList::Observer: | 37 // ImporterList::Observer: |
38 virtual void OnSourceProfilesLoaded() OVERRIDE; | 38 virtual void OnSourceProfilesLoaded() OVERRIDE; |
39 | 39 |
40 // importer::ImporterProgressObserver: | 40 // importer::ImporterProgressObserver: |
41 virtual void ImportStarted() OVERRIDE; | 41 virtual void ImportStarted() OVERRIDE; |
42 virtual void ImportItemStarted(importer::ImportItem item) OVERRIDE; | 42 virtual void ImportItemStarted(importer::ImportItem item) OVERRIDE; |
43 virtual void ImportItemEnded(importer::ImportItem item) OVERRIDE; | 43 virtual void ImportItemEnded(importer::ImportItem item) OVERRIDE; |
44 virtual void ImportEnded() OVERRIDE; | 44 virtual void ImportEnded() OVERRIDE; |
45 | 45 |
46 scoped_refptr<ImporterList> importer_list_; | 46 scoped_refptr<ImporterList> importer_list_; |
47 | 47 |
48 // If non-null it means importing is in progress. ImporterHost takes care | 48 // If non-null it means importing is in progress. ImporterHost takes care |
49 // of deleting itself when import is complete. | 49 // of deleting itself when import is complete. |
50 ImporterHost* importer_host_; // weak | 50 ImporterHost* importer_host_; // weak |
51 | 51 |
52 DISALLOW_COPY_AND_ASSIGN(ImportDataHandler); | 52 DISALLOW_COPY_AND_ASSIGN(ImportDataHandler); |
53 }; | 53 }; |
54 | 54 |
55 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_IMPORT_DATA_HANDLER_H_ | 55 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_IMPORT_DATA_HANDLER_H_ |
OLD | NEW |