diff options
author | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-04 02:31:20 +0000 |
---|---|---|
committer | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-04 02:31:20 +0000 |
commit | 198d0468712f48b7d02a5366cfa03989061ed147 (patch) | |
tree | f5e9166965cfaafba50f9532ab1049147c7b9710 /chrome/browser/views | |
parent | 6e853c3ad131fe6713ce8efbac2270fee26ab5b2 (diff) | |
download | chromium_src-198d0468712f48b7d02a5366cfa03989061ed147.zip chromium_src-198d0468712f48b7d02a5366cfa03989061ed147.tar.gz chromium_src-198d0468712f48b7d02a5366cfa03989061ed147.tar.bz2 |
Reland of r17500:
Theme our bookmark bar buttons.
BUG=12467
TEST=Apply a theme and verify that bookmark bar text colors changes.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17587 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r-- | chrome/browser/views/bookmark_bar_view.cc | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/chrome/browser/views/bookmark_bar_view.cc b/chrome/browser/views/bookmark_bar_view.cc index f151625..ba966593 100644 --- a/chrome/browser/views/bookmark_bar_view.cc +++ b/chrome/browser/views/bookmark_bar_view.cc @@ -381,11 +381,10 @@ BookmarkBarView::BookmarkBarView(Profile* profile, Browser* browser) Init(); SetProfile(profile); - if (IsAlwaysShown()) { + if (IsAlwaysShown()) size_animation_->Reset(1); - } else { + else size_animation_->Reset(0); - } } BookmarkBarView::~BookmarkBarView() { @@ -935,6 +934,15 @@ void BookmarkBarView::Loaded(BookmarkModel* model) { // Create a button for each of the children on the bookmark bar. for (int i = 0; i < node->GetChildCount(); ++i) AddChildView(i, CreateBookmarkButton(node->GetChild(i))); + + // This button is normally created too early to get access to the theme + // provider, so we change its color here; this also makes color changes from + // profile swaps work. + if (GetThemeProvider()) { + other_bookmarked_button_->SetEnabledColor(GetThemeProvider()-> + GetColor(BrowserThemeProvider::COLOR_BOOKMARK_TEXT)); + } + other_bookmarked_button_->SetEnabled(true); Layout(); @@ -1248,6 +1256,13 @@ views::View* BookmarkBarView::CreateBookmarkButton(BookmarkNode* node) { void BookmarkBarView::ConfigureButton(BookmarkNode* node, views::TextButton* button) { button->SetText(node->GetTitle()); + + // We don't always have a theme provider (ui tests, for example). + if (GetThemeProvider()) { + button->SetEnabledColor(GetThemeProvider()->GetColor( + BrowserThemeProvider::COLOR_BOOKMARK_TEXT)); + } + button->ClearMaxTextSize(); button->SetContextMenuController(this); button->SetDragController(this); |