diff options
author | mdm@chromium.org <mdm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-10 20:52:00 +0000 |
---|---|---|
committer | mdm@chromium.org <mdm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-10 20:52:00 +0000 |
commit | 90457b015a57f062d90498e10fbad57d3162f0a3 (patch) | |
tree | 70b37849fbf1ac34575c678502d8d2b5d6b1ca69 | |
parent | 1028591959701a057f1e6bc6e3ffe5a19892e26e (diff) | |
download | chromium_src-90457b015a57f062d90498e10fbad57d3162f0a3.zip chromium_src-90457b015a57f062d90498e10fbad57d3162f0a3.tar.gz chromium_src-90457b015a57f062d90498e10fbad57d3162f0a3.tar.bz2 |
Make the "get themes" button into a link instead.
BUG=21414
TEST=none
Review URL: http://codereview.chromium.org/203019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25913 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/gtk/options/content_page_gtk.cc | 3 | ||||
-rw-r--r-- | chrome/browser/views/options/content_page_view.cc | 23 | ||||
-rw-r--r-- | chrome/browser/views/options/content_page_view.h | 4 |
3 files changed, 17 insertions, 13 deletions
diff --git a/chrome/browser/gtk/options/content_page_gtk.cc b/chrome/browser/gtk/options/content_page_gtk.cc index 95a6476..32da520 100644 --- a/chrome/browser/gtk/options/content_page_gtk.cc +++ b/chrome/browser/gtk/options/content_page_gtk.cc @@ -9,6 +9,7 @@ #include "base/gfx/gtk_util.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/gtk/clear_browsing_data_dialog_gtk.h" +#include "chrome/browser/gtk/gtk_chrome_link_button.h" #include "chrome/browser/gtk/import_dialog_gtk.h" #include "chrome/browser/gtk/options/options_layout_gtk.h" #include "chrome/browser/gtk/options/passwords_exceptions_window_gtk.h" @@ -208,7 +209,7 @@ GtkWidget* ContentPageGtk::InitThemesGroup() { gtk_box_pack_start(GTK_BOX(hbox), themes_reset_button, FALSE, FALSE, 0); // Get themes button. - GtkWidget* themes_gallery_button = gtk_button_new_with_label( + GtkWidget* themes_gallery_button = gtk_chrome_link_button_new( l10n_util::GetStringUTF8(IDS_THEMES_GALLERY_BUTTON).c_str()); g_signal_connect(G_OBJECT(themes_gallery_button), "clicked", G_CALLBACK(OnGetThemesButtonClicked), this); diff --git a/chrome/browser/views/options/content_page_view.cc b/chrome/browser/views/options/content_page_view.cc index 4679338..14d2b49 100644 --- a/chrome/browser/views/options/content_page_view.cc +++ b/chrome/browser/views/options/content_page_view.cc @@ -54,7 +54,7 @@ ContentPageView::ContentPageView(Profile* profile) form_autofill_neversave_radio_(NULL), themes_group_(NULL), themes_reset_button_(NULL), - themes_gallery_button_(NULL), + themes_gallery_link_(NULL), browsing_data_label_(NULL), browsing_data_group_(NULL), import_button_(NULL), @@ -115,11 +115,6 @@ void ContentPageView::ButtonPressed( } else if (sender == themes_reset_button_) { UserMetricsRecordAction(L"Options_ThemesReset", profile()->GetPrefs()); profile()->ClearTheme(); - } else if (sender == themes_gallery_button_) { - UserMetricsRecordAction(L"Options_ThemesGallery", profile()->GetPrefs()); - BrowserList::GetLastActive()->OpenURL( - GURL(l10n_util::GetString(IDS_THEMES_GALLERY_URL)), - GURL(), NEW_FOREGROUND_TAB, PageTransition::LINK); } else if (sender == import_button_) { views::Window::CreateChromeWindow( GetWindow()->GetNativeWindow(), @@ -144,13 +139,20 @@ void ContentPageView::ButtonPressed( } } -#ifdef CHROME_PERSONALIZATION void ContentPageView::LinkActivated(views::Link* source, int event_flags) { + if (source == themes_gallery_link_) { + UserMetricsRecordAction(L"Options_ThemesGallery", profile()->GetPrefs()); + BrowserList::GetLastActive()->OpenURL( + GURL(l10n_util::GetString(IDS_THEMES_GALLERY_URL)), + GURL(), NEW_FOREGROUND_TAB, PageTransition::LINK); + return; + } +#ifdef CHROME_PERSONALIZATION DCHECK_EQ(source, sync_action_link_); DCHECK(sync_service_); sync_service_->ShowLoginDialog(); -} #endif +} //////////////////////////////////////////////////////////////////////////////// // ContentPageView, OptionsPageView implementation: @@ -341,8 +343,9 @@ void ContentPageView::InitFormAutofillGroup() { void ContentPageView::InitThemesGroup() { themes_reset_button_ = new views::NativeButton(this, l10n_util::GetString(IDS_THEMES_RESET_BUTTON)); - themes_gallery_button_ = new views::NativeButton(this, + themes_gallery_link_ = new views::Link( l10n_util::GetString(IDS_THEMES_GALLERY_BUTTON)); + themes_gallery_link_->SetController(this); using views::GridLayout; using views::ColumnSet; @@ -361,7 +364,7 @@ void ContentPageView::InitThemesGroup() { layout->StartRow(0, double_column_view_set_id); layout->AddView(themes_reset_button_); - layout->AddView(themes_gallery_button_); + layout->AddView(themes_gallery_link_); themes_group_ = new OptionsGroupView( contents, l10n_util::GetString(IDS_THEMES_GROUP_NAME), diff --git a/chrome/browser/views/options/content_page_view.h b/chrome/browser/views/options/content_page_view.h index 039f435..2b12a53 100644 --- a/chrome/browser/views/options/content_page_view.h +++ b/chrome/browser/views/options/content_page_view.h @@ -38,10 +38,10 @@ class ContentPageView : public OptionsPageView, // views::ButtonListener implementation: virtual void ButtonPressed(views::Button* sender, const views::Event& event); -#ifdef CHROME_PERSONALIZATION // views::LinkController method. virtual void LinkActivated(views::Link* source, int event_flags); +#ifdef CHROME_PERSONALIZATION // ProfileSyncServiceObserver method. virtual void OnStateChanged(); #endif @@ -91,7 +91,7 @@ class ContentPageView : public OptionsPageView, // Controls for the Themes group OptionsGroupView* themes_group_; views::NativeButton* themes_reset_button_; - views::NativeButton* themes_gallery_button_; + views::Link* themes_gallery_link_; // Controls for the browsing data group. OptionsGroupView* browsing_data_group_; |