OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/views/bookmarks/bookmark_bar_instructions_view.h" | 5 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_instructions_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/defaults.h" | 10 #include "chrome/browser/defaults.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 y = baseline_ - baseline; | 80 y = baseline_ - baseline; |
81 else | 81 else |
82 y = (height() - pref.height()) / 2; | 82 y = (height() - pref.height()) / 2; |
83 int view_width = std::min(remaining_width, pref.width()); | 83 int view_width = std::min(remaining_width, pref.width()); |
84 view->SetBounds(x, y, view_width, pref.height()); | 84 view->SetBounds(x, y, view_width, pref.height()); |
85 x += view_width + kViewPadding; | 85 x += view_width + kViewPadding; |
86 remaining_width = std::max(0, width() - x); | 86 remaining_width = std::max(0, width() - x); |
87 } | 87 } |
88 } | 88 } |
89 | 89 |
| 90 const char* BookmarkBarInstructionsView::GetClassName() const { |
| 91 return "BookmarkBarInstructionsView"; |
| 92 } |
| 93 |
90 void BookmarkBarInstructionsView::OnThemeChanged() { | 94 void BookmarkBarInstructionsView::OnThemeChanged() { |
91 UpdateColors(); | 95 UpdateColors(); |
92 } | 96 } |
93 | 97 |
94 void BookmarkBarInstructionsView::ViewHierarchyChanged( | 98 void BookmarkBarInstructionsView::ViewHierarchyChanged( |
95 const ViewHierarchyChangedDetails& details) { | 99 const ViewHierarchyChangedDetails& details) { |
96 if (!updated_colors_ && details.is_add && GetWidget()) | 100 if (!updated_colors_ && details.is_add && GetWidget()) |
97 UpdateColors(); | 101 UpdateColors(); |
98 } | 102 } |
99 | 103 |
(...skipping 20 matching lines...) Expand all Loading... |
120 const ui::ThemeProvider* theme_provider = GetThemeProvider(); | 124 const ui::ThemeProvider* theme_provider = GetThemeProvider(); |
121 if (!theme_provider) | 125 if (!theme_provider) |
122 return; | 126 return; |
123 updated_colors_ = true; | 127 updated_colors_ = true; |
124 SkColor text_color = | 128 SkColor text_color = |
125 theme_provider->GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT); | 129 theme_provider->GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT); |
126 instructions_->SetEnabledColor(text_color); | 130 instructions_->SetEnabledColor(text_color); |
127 if (import_link_) | 131 if (import_link_) |
128 import_link_->SetEnabledColor(text_color); | 132 import_link_->SetEnabledColor(text_color); |
129 } | 133 } |
OLD | NEW |