| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |