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

Unified Diff: chrome/browser/first_run/first_run_posix.cc

Issue 14322002: Remove unused ImportProgressDialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reverted ImportFromBrowser back to returning an int. Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/first_run/first_run_internal.h ('k') | chrome/browser/first_run/first_run_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/first_run/first_run_posix.cc
diff --git a/chrome/browser/first_run/first_run_posix.cc b/chrome/browser/first_run/first_run_posix.cc
index f71cf8170dc9cf5a1cef080a978363c3a9543540..eb9beccf92a328e06a6a480520bc01b8ee8db9c1 100644
--- a/chrome/browser/first_run/first_run_posix.cc
+++ b/chrome/browser/first_run/first_run_posix.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/first_run/first_run.h"
+#include "base/message_loop.h"
#include "base/path_service.h"
#include "base/prefs/pref_service.h"
#include "base/utf_string_conversions.h"
@@ -11,8 +12,6 @@
#include "chrome/browser/first_run/first_run_internal.h"
#include "chrome/browser/importer/importer_host.h"
#include "chrome/browser/importer/importer_list.h"
-#include "chrome/browser/importer/importer_progress_dialog.h"
-#include "chrome/browser/importer/importer_progress_observer.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
@@ -21,47 +20,6 @@
#include "chrome/installer/util/master_preferences.h"
#include "chrome/installer/util/master_preferences_constants.h"
-namespace {
-
-// This class acts as an observer for the ImporterProgressObserver::ImportEnded
-// callback. When the import process is started, certain errors may cause
-// ImportEnded() to be called synchronously, but the typical case is that
-// ImportEnded() is called asynchronously. Thus we have to handle both cases.
-class ImportEndedObserver : public importer::ImporterProgressObserver {
- public:
- ImportEndedObserver() : ended_(false),
- should_quit_message_loop_(false) {}
- virtual ~ImportEndedObserver() {}
-
- // importer::ImporterProgressObserver:
- virtual void ImportStarted() OVERRIDE {}
- virtual void ImportItemStarted(importer::ImportItem item) OVERRIDE {}
- virtual void ImportItemEnded(importer::ImportItem item) OVERRIDE {}
- virtual void ImportEnded() OVERRIDE {
- ended_ = true;
- if (should_quit_message_loop_)
- MessageLoop::current()->Quit();
- }
-
- void set_should_quit_message_loop() {
- should_quit_message_loop_ = true;
- }
-
- bool ended() {
- return ended_;
- }
-
- private:
- // Set if the import has ended.
- bool ended_;
-
- // Set by the client (via set_should_quit_message_loop) if, when the import
- // ends, this class should quit the message loop.
- bool should_quit_message_loop_;
-};
-
-} // namespace
-
namespace first_run {
namespace internal {
@@ -100,16 +58,16 @@ bool ImportSettings(Profile* profile,
if (items_to_import == 0)
return true;
- scoped_ptr<ImportEndedObserver> observer(new ImportEndedObserver);
- importer_host->SetObserver(observer.get());
+ ImportEndedObserver observer;
+ importer_host->SetObserver(&observer);
importer_host->StartImportSettings(source_profile,
profile,
items_to_import,
new ProfileWriter(profile),
true);
// If the import process has not errored out, block on it.
- if (!observer->ended()) {
- observer->set_should_quit_message_loop();
+ if (!observer.ended()) {
+ observer.set_should_quit_message_loop();
MessageLoop::current()->Run();
}
« no previous file with comments | « chrome/browser/first_run/first_run_internal.h ('k') | chrome/browser/first_run/first_run_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698