summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-19 18:39:37 +0000
committermirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-19 18:39:37 +0000
commit25252d649a2ffb210592e0356ea0cc38dd7747db (patch)
tree2ddb84bdea8c1acaa6213350294e35c56b816799
parentd9a68cfbd468f507f7408a2c614bed924aec7f26 (diff)
downloadchromium_src-25252d649a2ffb210592e0356ea0cc38dd7747db.zip
chromium_src-25252d649a2ffb210592e0356ea0cc38dd7747db.tar.gz
chromium_src-25252d649a2ffb210592e0356ea0cc38dd7747db.tar.bz2
Fix bookmark star button theming. Patch by Thiago Farina.
BUG= 35028 TEST= Apply a theme. Restart Chrome. Reset to default theme. Bookmark button is correctly returned to default. (see bug report) Review URL: http://codereview.chromium.org/630006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39461 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/views/toolbar_star_toggle.cc6
-rw-r--r--chrome/browser/views/toolbar_star_toggle.h5
-rw-r--r--chrome/browser/views/toolbar_view.cc4
3 files changed, 11 insertions, 4 deletions
diff --git a/chrome/browser/views/toolbar_star_toggle.cc b/chrome/browser/views/toolbar_star_toggle.cc
index 0c00475..710d6fa 100644
--- a/chrome/browser/views/toolbar_star_toggle.cc
+++ b/chrome/browser/views/toolbar_star_toggle.cc
@@ -42,13 +42,15 @@ ToolbarStarToggle::ToolbarStarToggle(views::ButtonListener* listener)
}
void ToolbarStarToggle::Init() {
- ThemeProvider* tp = profile_->GetThemeProvider();
-
set_tag(IDC_BOOKMARK_PAGE);
SetTooltipText(l10n_util::GetString(IDS_TOOLTIP_STAR));
SetToggledTooltipText(l10n_util::GetString(IDS_TOOLTIP_STARRED));
SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_STAR));
SetID(VIEW_ID_STAR_BUTTON);
+}
+
+void ToolbarStarToggle::LoadImages() {
+ ThemeProvider* tp = profile_->GetThemeProvider();
// Load images.
SkColor color = tp->GetColor(BrowserThemeProvider::COLOR_BUTTON_BACKGROUND);
diff --git a/chrome/browser/views/toolbar_star_toggle.h b/chrome/browser/views/toolbar_star_toggle.h
index 9cc1c7d..4966655 100644
--- a/chrome/browser/views/toolbar_star_toggle.h
+++ b/chrome/browser/views/toolbar_star_toggle.h
@@ -33,9 +33,12 @@ class ToolbarStarToggle : public views::ToggleImageButton,
bubble_positioner_ = bubble_positioner;
}
- // Sets up all labels and images for the button.
+ // Sets up all labels for the button.
void Init();
+ // Sets up all images for the button.
+ void LoadImages();
+
// If the bubble isn't showing, shows it.
void ShowStarBubble(const GURL& url, bool newly_bookmarked);
diff --git a/chrome/browser/views/toolbar_view.cc b/chrome/browser/views/toolbar_view.cc
index 2d751d2..2d18cad 100644
--- a/chrome/browser/views/toolbar_view.cc
+++ b/chrome/browser/views/toolbar_view.cc
@@ -572,7 +572,6 @@ void ToolbarView::CreateCenterStack(Profile *profile) {
star_->set_host_view(this);
star_->set_bubble_positioner(this);
star_->Init();
- AddChildView(star_);
location_bar_ = new LocationBarView(profile, browser_->command_updater(),
model_, this,
@@ -586,6 +585,7 @@ void ToolbarView::CreateCenterStack(Profile *profile) {
LoadCenterStackImages();
+ AddChildView(star_);
location_bar_->SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_LOCATION));
AddChildView(location_bar_);
location_bar_->Init();
@@ -664,6 +664,8 @@ void ToolbarView::LoadLeftSideControlsImages() {
}
void ToolbarView::LoadCenterStackImages() {
+ star_->LoadImages();
+
ThemeProvider* tp = GetThemeProvider();
SkColor color = tp->GetColor(BrowserThemeProvider::COLOR_BUTTON_BACKGROUND);