Don't show supervised user as "already on this device" while they're being imported.
[chromium-blink-merge.git] / chrome / browser / ui / webui / options / import_data_handler.h
blobec9da8da1580a68cef6732acbf6adf83cc7ebafa
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.
5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_IMPORT_DATA_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_IMPORT_DATA_HANDLER_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "chrome/browser/importer/importer_progress_observer.h"
12 #include "chrome/browser/ui/webui/options/options_ui.h"
13 #include "chrome/common/importer/importer_data_types.h"
14 #include "ui/shell_dialogs/select_file_dialog.h"
16 class ExternalProcessImporterHost;
17 class ImporterList;
19 namespace options {
21 // Chrome personal stuff import data overlay UI handler.
22 class ImportDataHandler : public OptionsPageUIHandler,
23 public importer::ImporterProgressObserver,
24 public ui::SelectFileDialog::Listener {
25 public:
26 ImportDataHandler();
27 ~ImportDataHandler() override;
29 // OptionsPageUIHandler:
30 void GetLocalizedValues(base::DictionaryValue* localized_strings) override;
31 void InitializeHandler() override;
32 void InitializePage() override;
34 // content::WebUIMessageHandler:
35 void RegisterMessages() override;
37 private:
38 void StartImport(const importer::SourceProfile& source_profile,
39 uint16 imported_items);
41 void ImportData(const base::ListValue* args);
43 // importer::ImporterProgressObserver:
44 void ImportStarted() override;
45 void ImportItemStarted(importer::ImportItem item) override;
46 void ImportItemEnded(importer::ImportItem item) override;
47 void ImportEnded() override;
49 // ui::SelectFileDialog::Listener:
50 void FileSelected(const base::FilePath& path,
51 int index,
52 void* params) override;
54 // Opens a file selection dialog to choose the bookmarks HTML file.
55 void HandleChooseBookmarksFile(const base::ListValue* args);
57 scoped_ptr<ImporterList> importer_list_;
59 // If non-null it means importing is in progress. ImporterHost takes care
60 // of deleting itself when import is complete.
61 ExternalProcessImporterHost* importer_host_; // weak
63 bool import_did_succeed_;
65 scoped_refptr<ui::SelectFileDialog> select_file_dialog_;
67 DISALLOW_COPY_AND_ASSIGN(ImportDataHandler);
70 } // namespace options
72 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_IMPORT_DATA_HANDLER_H_