summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhuanr@chromium.org <huanr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-09 18:30:45 +0000
committerhuanr@chromium.org <huanr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-09 18:30:45 +0000
commit539b3d8e469b5e2eb7f5609a356ba8a2f142f565 (patch)
treee0978a25bac8a51624ae7cc6e3fd362044af5ace
parent4ba315dabc71118b82d909162f8b4f023a34ff14 (diff)
downloadchromium_src-539b3d8e469b5e2eb7f5609a356ba8a2f142f565.zip
chromium_src-539b3d8e469b5e2eb7f5609a356ba8a2f142f565.tar.gz
chromium_src-539b3d8e469b5e2eb7f5609a356ba8a2f142f565.tar.bz2
Make bookmark import not to enable bookmark bar by default.
BUG=46528 TEST=mini_installer.exe --installerdata=<file_path> Review URL: http://codereview.chromium.org/2962004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51987 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/importer/firefox2_importer.cc4
-rw-r--r--chrome/browser/importer/importer.cc5
-rw-r--r--chrome/browser/importer/importer.h13
-rw-r--r--chrome/browser/importer/profile_writer.cc2
-rw-r--r--chrome/browser/importer/profile_writer.h5
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) {}