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

Side by Side Diff: chrome/browser/views/bookmark_bar_instructions_view.cc

Issue 2878055: Make theme change notifications auto-propagate through the view hierarchy, in... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/views/bookmark_bar_instructions_view.h" 5 #include "chrome/browser/views/bookmark_bar_instructions_view.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "chrome/browser/browser_theme_provider.h" 9 #include "chrome/browser/browser_theme_provider.h"
10 #include "chrome/browser/defaults.h" 10 #include "chrome/browser/defaults.h"
11 #include "grit/generated_resources.h" 11 #include "grit/generated_resources.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 y = baseline_ - baseline; 68 y = baseline_ - baseline;
69 else 69 else
70 y = (height() - pref.height()) / 2; 70 y = (height() - pref.height()) / 2;
71 int view_width = std::min(remaining_width, pref.width()); 71 int view_width = std::min(remaining_width, pref.width());
72 view->SetBounds(x, y, view_width, pref.height()); 72 view->SetBounds(x, y, view_width, pref.height());
73 x += view_width + kViewPadding; 73 x += view_width + kViewPadding;
74 remaining_width = std::max(0, width() - x); 74 remaining_width = std::max(0, width() - x);
75 } 75 }
76 } 76 }
77 77
78 void BookmarkBarInstructionsView::ThemeChanged() { 78 void BookmarkBarInstructionsView::OnThemeChanged() {
79 UpdateColors(); 79 UpdateColors();
80 } 80 }
81 81
82 void BookmarkBarInstructionsView::ViewHierarchyChanged(bool is_add, 82 void BookmarkBarInstructionsView::ViewHierarchyChanged(bool is_add,
83 View* parent, 83 View* parent,
84 View* child) { 84 View* child) {
85 if (!updated_colors_ && is_add && GetWidget()) 85 if (!updated_colors_ && is_add && GetWidget())
86 UpdateColors(); 86 UpdateColors();
87 } 87 }
88 88
(...skipping 17 matching lines...) Expand all
106 const ThemeProvider* theme_provider = GetThemeProvider(); 106 const ThemeProvider* theme_provider = GetThemeProvider();
107 if (!theme_provider) 107 if (!theme_provider)
108 return; 108 return;
109 updated_colors_ = true; 109 updated_colors_ = true;
110 SkColor text_color = 110 SkColor text_color =
111 theme_provider->GetColor(BrowserThemeProvider::COLOR_BOOKMARK_TEXT); 111 theme_provider->GetColor(BrowserThemeProvider::COLOR_BOOKMARK_TEXT);
112 instructions_->SetColor(text_color); 112 instructions_->SetColor(text_color);
113 if (import_link_) 113 if (import_link_)
114 import_link_->SetColor(text_color); 114 import_link_->SetColor(text_color);
115 } 115 }
OLDNEW
« no previous file with comments | « chrome/browser/views/bookmark_bar_instructions_view.h ('k') | chrome/browser/views/bookmark_bar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698