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

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

Issue 3223010: Add search engine selection dialog for Mac.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 3 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.cc ('k') | chrome/browser/first_run/first_run_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/first_run/first_run_gtk.cc
===================================================================
--- chrome/browser/first_run/first_run_gtk.cc (revision 60501)
+++ chrome/browser/first_run/first_run_gtk.cc (working copy)
@@ -22,44 +22,6 @@
#include "chrome/installer/util/google_update_settings.h"
#include "googleurl/src/gurl.h"
-namespace {
-
-// This class acts as an observer for the ImporterHost::Observer::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 ImporterHost::Observer {
- public:
- ImportEndedObserver()
- : ended_(false),
- quit_message_loop_(false) {
- }
- virtual ~ImportEndedObserver() {}
-
- virtual void ImportItemStarted(importer::ImportItem item) {}
- virtual void ImportItemEnded(importer::ImportItem item) {}
- virtual void ImportStarted() {}
- virtual void ImportEnded() {
- ended_ = true;
- if (quit_message_loop_)
- MessageLoop::current()->Quit();
- }
-
- void set_quit_message_loop() {
- quit_message_loop_ = true;
- }
-
- bool ended() {
- return ended_;
- }
-
- private:
- bool ended_;
- bool quit_message_loop_;
-};
-
-} // namespace
-
// TODO(port): This is just a piece of the silent import functionality from
// ImportSettings for Windows. It would be nice to get the rest of it ported.
bool FirstRun::ImportBookmarks(const FilePath& import_bookmarks_path) {
@@ -121,30 +83,7 @@
}
#endif // defined(OS_LINUX) && !defined(OS_CHROMEOS)
-// At least for now, we do profile import in-process on Linux.
// static
-bool FirstRun::ImportSettings(Profile* profile,
- scoped_refptr<ImporterHost> importer_host,
- int items_to_import) {
- // Import data.
- const ProfileInfo& source_profile = importer_host->GetSourceProfileInfoAt(0);
- scoped_ptr<ImportEndedObserver> observer(new ImportEndedObserver);
- importer_host->SetObserver(observer.get());
- 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_quit_message_loop();
- MessageLoop::current()->Run();
- }
- // Unfortunately there's no success/fail signal in ImporterHost.
- return true;
-}
-
-// static
void FirstRun::ShowFirstRunDialog(Profile* profile,
bool randomize_search_engine_experiment) {
FirstRunDialog::Show(profile, randomize_search_engine_experiment);
« no previous file with comments | « chrome/browser/first_run/first_run.cc ('k') | chrome/browser/first_run/first_run_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698