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 22 matching lines...) Expand all Loading... |
33 updated_colors_(false) { | 33 updated_colors_(false) { |
34 instructions_ = new views::Label( | 34 instructions_ = new views::Label( |
35 l10n_util::GetStringUTF16(IDS_BOOKMARKS_NO_ITEMS)); | 35 l10n_util::GetStringUTF16(IDS_BOOKMARKS_NO_ITEMS)); |
36 instructions_->SetAutoColorReadabilityEnabled(false); | 36 instructions_->SetAutoColorReadabilityEnabled(false); |
37 AddChildView(instructions_); | 37 AddChildView(instructions_); |
38 | 38 |
39 if (browser_defaults::kShowImportOnBookmarkBar) { | 39 if (browser_defaults::kShowImportOnBookmarkBar) { |
40 import_link_ = new views::Link( | 40 import_link_ = new views::Link( |
41 l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_IMPORT_LINK)); | 41 l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_IMPORT_LINK)); |
42 // We don't want the link to alter tab navigation. | 42 // We don't want the link to alter tab navigation. |
43 import_link_->set_focusable(false); | 43 import_link_->SetFocusable(false); |
44 import_link_->set_listener(this); | 44 import_link_->set_listener(this); |
45 import_link_->set_context_menu_controller(this); | 45 import_link_->set_context_menu_controller(this); |
46 import_link_->SetAutoColorReadabilityEnabled(false); | 46 import_link_->SetAutoColorReadabilityEnabled(false); |
47 AddChildView(import_link_); | 47 AddChildView(import_link_); |
48 } | 48 } |
49 } | 49 } |
50 | 50 |
51 gfx::Size BookmarkBarInstructionsView::GetPreferredSize() { | 51 gfx::Size BookmarkBarInstructionsView::GetPreferredSize() { |
52 int ascent = 0, descent = 0, height = 0, width = 0; | 52 int ascent = 0, descent = 0, height = 0, width = 0; |
53 for (int i = 0; i < child_count(); ++i) { | 53 for (int i = 0; i < child_count(); ++i) { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 const ui::ThemeProvider* theme_provider = GetThemeProvider(); | 120 const ui::ThemeProvider* theme_provider = GetThemeProvider(); |
121 if (!theme_provider) | 121 if (!theme_provider) |
122 return; | 122 return; |
123 updated_colors_ = true; | 123 updated_colors_ = true; |
124 SkColor text_color = | 124 SkColor text_color = |
125 theme_provider->GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT); | 125 theme_provider->GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT); |
126 instructions_->SetEnabledColor(text_color); | 126 instructions_->SetEnabledColor(text_color); |
127 if (import_link_) | 127 if (import_link_) |
128 import_link_->SetEnabledColor(text_color); | 128 import_link_->SetEnabledColor(text_color); |
129 } | 129 } |
OLD | NEW |