Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(224)

Side by Side Diff: chrome/browser/importer/importer_host.h

Issue 10690151: Move implementation of BrowserList onto an inner, instantiatable class, BrowserListImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_IMPORTER_IMPORTER_HOST_H_ 5 #ifndef CHROME_BROWSER_IMPORTER_IMPORTER_HOST_H_
6 #define CHROME_BROWSER_IMPORTER_IMPORTER_HOST_H_ 6 #define CHROME_BROWSER_IMPORTER_IMPORTER_HOST_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "chrome/browser/bookmarks/base_bookmark_model_observer.h" 14 #include "chrome/browser/bookmarks/base_bookmark_model_observer.h"
15 #include "chrome/browser/importer/importer_data_types.h" 15 #include "chrome/browser/importer/importer_data_types.h"
16 #include "chrome/browser/importer/profile_writer.h" 16 #include "chrome/browser/importer/profile_writer.h"
17 #include "chrome/browser/ui/browser_list.h" 17 #include "chrome/browser/ui/browser_list_observer.h"
18 #include "content/public/browser/notification_observer.h" 18 #include "content/public/browser/notification_observer.h"
19 #include "content/public/browser/notification_registrar.h" 19 #include "content/public/browser/notification_registrar.h"
20 #include "ui/gfx/native_widget_types.h" 20 #include "ui/gfx/native_widget_types.h"
21 21
22 class FirefoxProfileLock; 22 class FirefoxProfileLock;
23 class Importer; 23 class Importer;
24 class Profile; 24 class Profile;
25 25
26 namespace importer { 26 namespace importer {
27 class ImporterProgressObserver; 27 class ImporterProgressObserver;
28 } 28 }
29 29
30 // This class hosts the importers. It enumerates profiles from other 30 // This class hosts the importers. It enumerates profiles from other
31 // browsers dynamically, and controls the process of importing. When 31 // browsers dynamically, and controls the process of importing. When
32 // the import process is done, ImporterHost deletes itself. 32 // the import process is done, ImporterHost deletes itself.
33 class ImporterHost : public base::RefCountedThreadSafe<ImporterHost>, 33 class ImporterHost : public base::RefCountedThreadSafe<ImporterHost>,
34 public BaseBookmarkModelObserver, 34 public BaseBookmarkModelObserver,
35 public content::NotificationObserver, 35 public content::NotificationObserver,
36 public BrowserList::Observer { 36 public chrome::BrowserListObserver {
37 public: 37 public:
38 ImporterHost(); 38 ImporterHost();
39 39
40 // ShowWarningDialog() asks user to close the application that is owning the 40 // ShowWarningDialog() asks user to close the application that is owning the
41 // lock. They can retry or skip the importing process. 41 // lock. They can retry or skip the importing process.
42 void ShowWarningDialog(); 42 void ShowWarningDialog();
43 43
44 // This is called when when user ends the lock dialog by clicking on either 44 // This is called when when user ends the lock dialog by clicking on either
45 // the "Skip" or "Continue" buttons. |is_continue| is true when user clicked 45 // the "Skip" or "Continue" buttons. |is_continue| is true when user clicked
46 // the "Continue" button. 46 // the "Continue" button.
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 virtual void Loaded(BookmarkModel* model, bool ids_reassigned) OVERRIDE; 136 virtual void Loaded(BookmarkModel* model, bool ids_reassigned) OVERRIDE;
137 virtual void BookmarkModelBeingDeleted(BookmarkModel* model) OVERRIDE; 137 virtual void BookmarkModelBeingDeleted(BookmarkModel* model) OVERRIDE;
138 virtual void BookmarkModelChanged() OVERRIDE; 138 virtual void BookmarkModelChanged() OVERRIDE;
139 139
140 // content::NotificationObserver: 140 // content::NotificationObserver:
141 // Called when TemplateURLService has been loaded. 141 // Called when TemplateURLService has been loaded.
142 virtual void Observe(int type, 142 virtual void Observe(int type,
143 const content::NotificationSource& source, 143 const content::NotificationSource& source,
144 const content::NotificationDetails& details) OVERRIDE; 144 const content::NotificationDetails& details) OVERRIDE;
145 145
146 // BrowserList::Observer 146 // chrome::BrowserListObserver
147 virtual void OnBrowserRemoved(Browser* browser) OVERRIDE; 147 virtual void OnBrowserRemoved(Browser* browser) OVERRIDE;
148 148
149 // The task is the process of importing settings from other browsers. 149 // The task is the process of importing settings from other browsers.
150 base::Closure task_; 150 base::Closure task_;
151 151
152 // The importer used in the task. 152 // The importer used in the task.
153 Importer* importer_; 153 Importer* importer_;
154 154
155 // True if UI is not to be shown. 155 // True if UI is not to be shown.
156 bool headless_; 156 bool headless_;
157 157
158 // Parent window that we pass to the import lock dialog (i.e, the Firefox 158 // Parent window that we pass to the import lock dialog (i.e, the Firefox
159 // warning dialog). 159 // warning dialog).
160 gfx::NativeWindow parent_window_; 160 gfx::NativeWindow parent_window_;
161 161
162 // Used to add a new tab if we need the user to sign in. 162 // Used to add a new tab if we need the user to sign in.
163 Browser* browser_; 163 Browser* browser_;
164 164
165 // The observer that we need to notify about changes in the import process. 165 // The observer that we need to notify about changes in the import process.
166 importer::ImporterProgressObserver* observer_; 166 importer::ImporterProgressObserver* observer_;
167 167
168 // Firefox profile lock. 168 // Firefox profile lock.
169 scoped_ptr<FirefoxProfileLock> firefox_lock_; 169 scoped_ptr<FirefoxProfileLock> firefox_lock_;
170 170
171 DISALLOW_COPY_AND_ASSIGN(ImporterHost); 171 DISALLOW_COPY_AND_ASSIGN(ImporterHost);
172 }; 172 };
173 173
174 #endif // CHROME_BROWSER_IMPORTER_IMPORTER_HOST_H_ 174 #endif // CHROME_BROWSER_IMPORTER_IMPORTER_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698