summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/import_dialog_gtk.cc
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-27 18:39:49 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-27 18:39:49 +0000
commit57b8ac20d2251996c29cd1935ba6a65679a9c149 (patch)
tree11c1e057f1801970b09d91e36e64e9c152e458d9 /chrome/browser/gtk/import_dialog_gtk.cc
parent4636504633191de33976de1d29aa66647b90f77f (diff)
downloadchromium_src-57b8ac20d2251996c29cd1935ba6a65679a9c149.zip
chromium_src-57b8ac20d2251996c29cd1935ba6a65679a9c149.tar.gz
chromium_src-57b8ac20d2251996c29cd1935ba6a65679a9c149.tar.bz2
gtk: Implements bookmark bar import promotion link, that when clicked imports bookmarks.
Based on this patch: http://codereview.chromium.org/440029 BUG=28754 TEST=manually Review URL: http://codereview.chromium.org/549001 Patch from thiago.farina@gmail.com. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37275 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/import_dialog_gtk.cc')
-rw-r--r--chrome/browser/gtk/import_dialog_gtk.cc25
1 files changed, 17 insertions, 8 deletions
diff --git a/chrome/browser/gtk/import_dialog_gtk.cc b/chrome/browser/gtk/import_dialog_gtk.cc
index 877e07c..71546b2 100644
--- a/chrome/browser/gtk/import_dialog_gtk.cc
+++ b/chrome/browser/gtk/import_dialog_gtk.cc
@@ -11,8 +11,9 @@
#include "grit/locale_settings.h"
// static
-void ImportDialogGtk::Show(GtkWindow* parent, Profile* profile) {
- new ImportDialogGtk(parent, profile);
+void ImportDialogGtk::Show(GtkWindow* parent, Profile* profile,
+ int initial_state) {
+ new ImportDialogGtk(parent, profile, initial_state);
}
////////////////////////////////////////////////////////////////////////////////
@@ -26,8 +27,12 @@ void ImportDialogGtk::ImportComplete() {
delete this;
}
-ImportDialogGtk::ImportDialogGtk(GtkWindow* parent, Profile* profile)
- : parent_(parent), profile_(profile), importer_host_(new ImporterHost()) {
+ImportDialogGtk::ImportDialogGtk(GtkWindow* parent, Profile* profile,
+ int initial_state)
+ : parent_(parent),
+ profile_(profile),
+ importer_host_(new ImporterHost()),
+ initial_state_(initial_state) {
// Build the dialog.
dialog_ = gtk_dialog_new_with_buttons(
l10n_util::GetStringUTF8(IDS_IMPORT_SETTINGS_TITLE).c_str(),
@@ -74,22 +79,26 @@ ImportDialogGtk::ImportDialogGtk(GtkWindow* parent, Profile* profile)
bookmarks_ = gtk_check_button_new_with_label(
l10n_util::GetStringUTF8(IDS_IMPORT_FAVORITES_CHKBOX).c_str());
gtk_box_pack_start(GTK_BOX(vbox), bookmarks_, FALSE, FALSE, 0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(bookmarks_), TRUE);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(bookmarks_),
+ (initial_state_ & FAVORITES) != 0);
search_engines_ = gtk_check_button_new_with_label(
l10n_util::GetStringUTF8(IDS_IMPORT_SEARCH_ENGINES_CHKBOX).c_str());
gtk_box_pack_start(GTK_BOX(vbox), search_engines_, FALSE, FALSE, 0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(search_engines_), TRUE);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(search_engines_),
+ (initial_state_ & SEARCH_ENGINES) != 0);
passwords_ = gtk_check_button_new_with_label(
l10n_util::GetStringUTF8(IDS_IMPORT_PASSWORDS_CHKBOX).c_str());
gtk_box_pack_start(GTK_BOX(vbox), passwords_, FALSE, FALSE, 0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(passwords_), TRUE);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(passwords_),
+ (initial_state_ & PASSWORDS) != 0);
history_ = gtk_check_button_new_with_label(
l10n_util::GetStringUTF8(IDS_IMPORT_HISTORY_CHKBOX).c_str());
gtk_box_pack_start(GTK_BOX(vbox), history_, FALSE, FALSE, 0);
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(history_), TRUE);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(history_),
+ (initial_state_ & HISTORY) !=0);
gtk_box_pack_start(GTK_BOX(content_area), vbox, FALSE, FALSE, 0);