| OLD | NEW |
| 1 // Copyright (c) 2010 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_DOM_UI_OPTIONS_IMPORT_DATA_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_DOM_UI_OPTIONS_IMPORT_DATA_HANDLER_H_ |
| 6 #define CHROME_BROWSER_DOM_UI_OPTIONS_IMPORT_DATA_HANDLER_H_ | 6 #define CHROME_BROWSER_DOM_UI_OPTIONS_IMPORT_DATA_HANDLER_H_ |
| 7 #pragma once |
| 7 | 8 |
| 8 #include "base/ref_counted.h" | 9 #include "chrome/browser/webui/options/import_data_handler.h" |
| 9 #include "chrome/browser/dom_ui/options/options_ui.h" | 10 // TODO(tfarina): remove this file once all includes have been updated. |
| 10 #include "chrome/browser/importer/importer.h" | |
| 11 | |
| 12 // Chrome personal stuff import data overlay UI handler. | |
| 13 class ImportDataHandler : public OptionsPageUIHandler, | |
| 14 public ImporterHost::Observer, | |
| 15 public ImporterList::Observer { | |
| 16 public: | |
| 17 ImportDataHandler(); | |
| 18 virtual ~ImportDataHandler(); | |
| 19 | |
| 20 // OptionsUIHandler implementation. | |
| 21 virtual void GetLocalizedValues(DictionaryValue* localized_strings); | |
| 22 virtual void Initialize(); | |
| 23 | |
| 24 // WebUIMessageHandler implementation. | |
| 25 virtual void RegisterMessages(); | |
| 26 | |
| 27 private: | |
| 28 void ImportData(const ListValue* args); | |
| 29 | |
| 30 // ImporterHost::Observer implementation. | |
| 31 virtual void ImportStarted(); | |
| 32 virtual void ImportItemStarted(importer::ImportItem item); | |
| 33 virtual void ImportItemEnded(importer::ImportItem item); | |
| 34 virtual void ImportEnded(); | |
| 35 | |
| 36 // ImporterList::Observer implementation. | |
| 37 virtual void SourceProfilesLoaded(); | |
| 38 | |
| 39 scoped_refptr<ImporterList> importer_list_; | |
| 40 | |
| 41 // If non-null it means importing is in progress. ImporterHost takes care | |
| 42 // of deleting itself when import is complete. | |
| 43 ImporterHost* importer_host_; // weak | |
| 44 | |
| 45 DISALLOW_COPY_AND_ASSIGN(ImportDataHandler); | |
| 46 }; | |
| 47 | 11 |
| 48 #endif // CHROME_BROWSER_DOM_UI_OPTIONS_IMPORT_DATA_HANDLER_H_ | 12 #endif // CHROME_BROWSER_DOM_UI_OPTIONS_IMPORT_DATA_HANDLER_H_ |
| OLD | NEW |