diff options
author | cpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-31 23:44:54 +0000 |
---|---|---|
committer | cpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-31 23:44:54 +0000 |
commit | 6cd5bfff0526b34183e4a5508920b11515e4461b (patch) | |
tree | 2cdf258eddd73793809a2f7e1fb51165dddb200a /chrome/browser/importer | |
parent | aa156ca673791d7dfeffd02862c28a7b25f08c7c (diff) | |
download | chromium_src-6cd5bfff0526b34183e4a5508920b11515e4461b.zip chromium_src-6cd5bfff0526b34183e4a5508920b11515e4461b.tar.gz chromium_src-6cd5bfff0526b34183e4a5508920b11515e4461b.tar.bz2 |
On first run process the master prefs json, only one entry matters to us.
- skip or not first run dialgos
- on skip import silently search provider only
BUG=1394863
Review URL: http://codereview.chromium.org/8758
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4346 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/importer')
-rw-r--r-- | chrome/browser/importer/importer.cc | 13 | ||||
-rw-r--r-- | chrome/browser/importer/importer.h | 13 |
2 files changed, 22 insertions, 4 deletions
diff --git a/chrome/browser/importer/importer.cc b/chrome/browser/importer/importer.cc index 4c600d9..e1cbd13 100644 --- a/chrome/browser/importer/importer.cc +++ b/chrome/browser/importer/importer.cc @@ -308,7 +308,8 @@ ImporterHost::ImporterHost() file_loop_(g_browser_process->file_thread()->message_loop()), waiting_for_bookmarkbar_model_(false), waiting_for_template_url_model_(false), - is_source_readable_(true) { + is_source_readable_(true), + headless_(false) { DetectSourceProfiles(); } @@ -319,7 +320,8 @@ ImporterHost::ImporterHost(MessageLoop* file_loop) file_loop_(file_loop), waiting_for_bookmarkbar_model_(false), waiting_for_template_url_model_(false), - is_source_readable_(true) { + is_source_readable_(true), + headless_(false) { DetectSourceProfiles(); } @@ -346,8 +348,11 @@ void ImporterHost::Observe(NotificationType type, } void ImporterHost::ShowWarningDialog() { - views::Window::CreateChromeWindow(GetActiveWindow(), gfx::Rect(), - new ImporterLockView(this))->Show(); + if (headless_) + OnLockViewEnd(false); + else + views::Window::CreateChromeWindow(GetActiveWindow(), gfx::Rect(), + new ImporterLockView(this))->Show(); } void ImporterHost::OnLockViewEnd(bool is_continue) { diff --git a/chrome/browser/importer/importer.h b/chrome/browser/importer/importer.h index 494cf1c..3d83ca0 100644 --- a/chrome/browser/importer/importer.h +++ b/chrome/browser/importer/importer.h @@ -164,6 +164,16 @@ class ImporterHost : public base::RefCounted<ImporterHost>, // Cancel void Cancel(); + // When in headless mode, the importer will not show the warning dialog and + // the outcome is as if the user had canceled the import operation. + void set_headless() { + headless_ = true; + } + + bool is_headless() const { + return headless_; + } + // An interface which an object can implement to be notified of events during // the import process. class Observer { @@ -241,6 +251,9 @@ class ImporterHost : public base::RefCounted<ImporterHost>, // True if source profile is readable. bool is_source_readable_; + // True if UI is not to be shown. + bool headless_; + // Firefox profile lock. scoped_ptr<FirefoxProfileLock> firefox_lock_; |