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

Unified Diff: chrome/browser/gtk/options/content_page_gtk.cc

Issue 2847072: Green Tree Tactical Force: Revert skrul's bad commits (probably a git-cl bug). (Closed)
Patch Set: Created 10 years, 5 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/gtk/options/content_page_gtk.h ('k') | chrome/browser/sync/profile_sync_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/options/content_page_gtk.cc
diff --git a/chrome/browser/gtk/options/content_page_gtk.cc b/chrome/browser/gtk/options/content_page_gtk.cc
index a6607950416a564e57f0a2baa7b60677a38dc767..1532e2cbcff944c2910fc670a0edd5793b64da8a 100644
--- a/chrome/browser/gtk/options/content_page_gtk.cc
+++ b/chrome/browser/gtk/options/content_page_gtk.cc
@@ -75,8 +75,8 @@ ContentPageGtk::ContentPageGtk(Profile* profile)
#if !defined(OS_CHROMEOS)
sync_action_link_background_(NULL),
sync_action_link_(NULL),
-#endif
sync_start_stop_button_(NULL),
+#endif
sync_customize_button_(NULL),
privacy_dashboard_link_(NULL),
initializing_(true),
@@ -112,9 +112,11 @@ ContentPageGtk::ContentPageGtk(Profile* profile)
options_builder->AddOptionGroup(
l10n_util::GetStringUTF8(IDS_AUTOFILL_SETTING_WINDOWS_GROUP_NAME),
InitFormAutoFillGroup(), false);
+#if !defined(OS_CHROMEOS)
options_builder->AddOptionGroup(
l10n_util::GetStringUTF8(IDS_OPTIONS_BROWSING_DATA_GROUP_NAME),
InitBrowsingDataGroup(), false);
+#endif
options_builder->AddOptionGroup(
l10n_util::GetStringUTF8(IDS_APPEARANCE_GROUP_NAME),
InitThemesGroup(), false);
@@ -356,11 +358,13 @@ GtkWidget* ContentPageGtk::InitSyncGroup() {
// depend on the spacing above.
GtkWidget* button_hbox = gtk_hbox_new(FALSE, gtk_util::kLabelSpacing);
gtk_container_add(GTK_CONTAINER(vbox), button_hbox);
+#if !defined(OS_CHROMEOS)
sync_start_stop_button_ = gtk_button_new_with_label("");
g_signal_connect(sync_start_stop_button_, "clicked",
G_CALLBACK(OnSyncStartStopButtonClickedThunk), this);
gtk_box_pack_start(GTK_BOX(button_hbox), sync_start_stop_button_, FALSE,
FALSE, 0);
+#endif
sync_customize_button_ = gtk_button_new_with_label("");
g_signal_connect(sync_customize_button_, "clicked",
G_CALLBACK(OnSyncCustomizeButtonClickedThunk), this);
@@ -395,49 +399,29 @@ void ContentPageGtk::UpdateSyncControls() {
string16 status_label;
string16 link_label;
std::string customize_button_label;
+ std::string button_label;
bool managed = sync_service_->IsManaged();
bool sync_setup_completed = sync_service_->HasSyncSetupCompleted();
bool status_has_error = sync_ui_util::GetStatusLabels(sync_service_,
&status_label, &link_label) == sync_ui_util::SYNC_ERROR;
customize_button_label =
l10n_util::GetStringUTF8(IDS_SYNC_CUSTOMIZE_BUTTON_LABEL);
-
- std::string start_stop_button_label;
- bool is_start_stop_button_visible = false;
- bool is_start_stop_button_sensitive = false;
if (sync_setup_completed) {
- start_stop_button_label =
- l10n_util::GetStringUTF8(IDS_SYNC_STOP_SYNCING_BUTTON_LABEL);
-#if defined(OS_CHROMEOS)
- is_start_stop_button_visible = false;
-#else
- is_start_stop_button_visible = true;
-#endif
- is_start_stop_button_sensitive = !managed;
+ button_label = l10n_util::GetStringUTF8(IDS_SYNC_STOP_SYNCING_BUTTON_LABEL);
} else if (sync_service_->SetupInProgress()) {
- start_stop_button_label =
- l10n_util::GetStringUTF8(IDS_SYNC_NTP_SETUP_IN_PROGRESS);
- is_start_stop_button_visible = true;
- is_start_stop_button_sensitive = false;
+ button_label = l10n_util::GetStringUTF8(IDS_SYNC_NTP_SETUP_IN_PROGRESS);
} else {
- start_stop_button_label =
- l10n_util::GetStringUTF8(IDS_SYNC_START_SYNC_BUTTON_LABEL);
- is_start_stop_button_visible = true;
- is_start_stop_button_sensitive = !managed;
+ button_label = l10n_util::GetStringUTF8(IDS_SYNC_START_SYNC_BUTTON_LABEL);
}
- gtk_widget_set_no_show_all(sync_start_stop_button_,
- !is_start_stop_button_visible);
- if (is_start_stop_button_visible)
- gtk_widget_show(sync_start_stop_button_);
- else
- gtk_widget_hide(sync_start_stop_button_);
- gtk_widget_set_sensitive(sync_start_stop_button_,
- is_start_stop_button_sensitive);
- gtk_button_set_label(GTK_BUTTON(sync_start_stop_button_),
- start_stop_button_label.c_str());
gtk_label_set_label(GTK_LABEL(sync_status_label_),
UTF16ToUTF8(status_label).c_str());
+#if !defined(OS_CHROMEOS)
+ gtk_widget_set_sensitive(sync_start_stop_button_,
+ !sync_service_->WizardIsVisible() && !managed);
+ gtk_button_set_label(GTK_BUTTON(sync_start_stop_button_),
+ button_label.c_str());
+#endif
gtk_widget_set_child_visible(sync_customize_button_,
sync_setup_completed && !status_has_error);
« no previous file with comments | « chrome/browser/gtk/options/content_page_gtk.h ('k') | chrome/browser/sync/profile_sync_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698