diff options
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/importer/firefox2_importer.cc | 4 | ||||
-rw-r--r-- | chrome/browser/importer/importer.cc | 5 | ||||
-rw-r--r-- | chrome/browser/importer/importer.h | 13 | ||||
-rw-r--r-- | chrome/browser/importer/profile_writer.cc | 2 | ||||
-rw-r--r-- | chrome/browser/importer/profile_writer.h | 5 |
5 files changed, 24 insertions, 5 deletions
diff --git a/chrome/browser/importer/firefox2_importer.cc b/chrome/browser/importer/firefox2_importer.cc index 211bfc9..d551105 100644 --- a/chrome/browser/importer/firefox2_importer.cc +++ b/chrome/browser/importer/firefox2_importer.cc @@ -276,7 +276,9 @@ void Firefox2Importer::ImportBookmarks() { if (!bookmarks.empty() && !cancelled()) { int options = 0; if (import_to_bookmark_bar()) - options = ProfileWriter::IMPORT_TO_BOOKMARK_BAR; + options |= ProfileWriter::IMPORT_TO_BOOKMARK_BAR; + if (bookmark_bar_disabled()) + options |= ProfileWriter::BOOKMARK_BAR_DISABLED; bridge_->AddBookmarkEntries(bookmarks, first_folder_name, options); } if (!parsing_bookmarks_html_file_ && !template_urls.empty() && diff --git a/chrome/browser/importer/importer.cc b/chrome/browser/importer/importer.cc index fcb8f28..62376c3 100644 --- a/chrome/browser/importer/importer.cc +++ b/chrome/browser/importer/importer.cc @@ -39,7 +39,8 @@ using webkit_glue::PasswordForm; Importer::Importer() : cancelled_(false), - import_to_bookmark_bar_(false) { + import_to_bookmark_bar_(false), + bookmark_bar_disabled_(false) { } Importer::~Importer() { @@ -177,6 +178,7 @@ void ImporterHost::StartImportSettings( importer_->AddRef(); importer_->set_import_to_bookmark_bar(ShouldImportToBookmarkBar(first_run)); + importer_->set_bookmark_bar_disabled(first_run); scoped_refptr<ImporterBridge> bridge( new InProcessImporterBridge(writer_.get(), this)); task_ = NewRunnableMethod(importer_, &Importer::StartImport, @@ -584,4 +586,3 @@ void ExternalProcessImporterClient::OnKeywordsImportReady( bridge_->SetKeywords(template_url_vec, default_keyword_index, unique_on_host_and_path); } - diff --git a/chrome/browser/importer/importer.h b/chrome/browser/importer/importer.h index a6c34ce..eec498b 100644 --- a/chrome/browser/importer/importer.h +++ b/chrome/browser/importer/importer.h @@ -451,6 +451,14 @@ class Importer : public base::RefCountedThreadSafe<Importer> { import_to_bookmark_bar_ = import_to_bookmark_bar; } + void set_bookmark_bar_disabled(bool bookmark_bar_disabled) { + bookmark_bar_disabled_ = bookmark_bar_disabled; + } + + bool bookmark_bar_disabled() { + return bookmark_bar_disabled_; + } + bool cancelled() const { return cancelled_; } protected: @@ -476,6 +484,11 @@ class Importer : public base::RefCountedThreadSafe<Importer> { // True if the importer is created in the first run UI. bool import_to_bookmark_bar_; + // Whether bookmark bar is disabled (not shown) for importer. This is set + // true during first run to prevent out of process bookmark importer from + // updating bookmark bar settings. + bool bookmark_bar_disabled_; + DISALLOW_COPY_AND_ASSIGN(Importer); }; diff --git a/chrome/browser/importer/profile_writer.cc b/chrome/browser/importer/profile_writer.cc index f3b469f..0061efc 100644 --- a/chrome/browser/importer/profile_writer.cc +++ b/chrome/browser/importer/profile_writer.cc @@ -131,7 +131,7 @@ void ProfileWriter::AddBookmarkEntry( model->EndImportMode(); } - if (show_bookmark_toolbar) + if (show_bookmark_toolbar && !(options & BOOKMARK_BAR_DISABLED)) ShowBookmarkBar(); } diff --git a/chrome/browser/importer/profile_writer.h b/chrome/browser/importer/profile_writer.h index 71d2d6b..38e04d8 100644 --- a/chrome/browser/importer/profile_writer.h +++ b/chrome/browser/importer/profile_writer.h @@ -40,7 +40,10 @@ class ProfileWriter : public base::RefCountedThreadSafe<ProfileWriter> { ADD_IF_UNIQUE = 1 << 0, // Indicates the bookmarks should be added to the bookmark bar. - IMPORT_TO_BOOKMARK_BAR = 1 << 1 + IMPORT_TO_BOOKMARK_BAR = 1 << 1, + + // Indicates the bookmark bar is not shown. + BOOKMARK_BAR_DISABLED = 1 << 2 }; explicit ProfileWriter(Profile* profile) : profile_(profile) {} |