OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/defaults.h" | 10 #include "chrome/browser/defaults.h" |
11 #include "chrome/browser/themes/theme_service.h" | 11 #include "chrome/browser/themes/theme_service.h" |
| 12 #include "chrome/browser/ui/bookmarks/bookmark_bar_instructions_delegate.h" |
12 #include "grit/generated_resources.h" | 13 #include "grit/generated_resources.h" |
13 #include "ui/base/l10n/l10n_util.h" | 14 #include "ui/base/l10n/l10n_util.h" |
14 #include "ui/views/controls/label.h" | 15 #include "ui/views/controls/label.h" |
15 #include "ui/views/controls/link.h" | 16 #include "ui/views/controls/link.h" |
16 | 17 |
17 namespace { | 18 namespace { |
18 | 19 |
19 // Horizontal padding, in pixels, between the link and label. | 20 // Horizontal padding, in pixels, between the link and label. |
20 const int kViewPadding = 6; | 21 const int kViewPadding = 6; |
21 | 22 |
22 } // namespace | 23 } // namespace |
23 | 24 |
24 BookmarkBarInstructionsView::BookmarkBarInstructionsView(Delegate* delegate) | 25 BookmarkBarInstructionsView::BookmarkBarInstructionsView( |
| 26 chrome::BookmarkBarInstructionsDelegate* delegate) |
25 : delegate_(delegate), | 27 : delegate_(delegate), |
26 instructions_(NULL), | 28 instructions_(NULL), |
27 import_link_(NULL), | 29 import_link_(NULL), |
28 baseline_(-1), | 30 baseline_(-1), |
29 updated_colors_(false) { | 31 updated_colors_(false) { |
30 instructions_ = new views::Label( | 32 instructions_ = new views::Label( |
31 l10n_util::GetStringUTF16(IDS_BOOKMARKS_NO_ITEMS)); | 33 l10n_util::GetStringUTF16(IDS_BOOKMARKS_NO_ITEMS)); |
32 instructions_->SetAutoColorReadabilityEnabled(false); | 34 instructions_->SetAutoColorReadabilityEnabled(false); |
33 AddChildView(instructions_); | 35 AddChildView(instructions_); |
34 | 36 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 const ui::ThemeProvider* theme_provider = GetThemeProvider(); | 110 const ui::ThemeProvider* theme_provider = GetThemeProvider(); |
109 if (!theme_provider) | 111 if (!theme_provider) |
110 return; | 112 return; |
111 updated_colors_ = true; | 113 updated_colors_ = true; |
112 SkColor text_color = | 114 SkColor text_color = |
113 theme_provider->GetColor(ThemeService::COLOR_BOOKMARK_TEXT); | 115 theme_provider->GetColor(ThemeService::COLOR_BOOKMARK_TEXT); |
114 instructions_->SetEnabledColor(text_color); | 116 instructions_->SetEnabledColor(text_color); |
115 if (import_link_) | 117 if (import_link_) |
116 import_link_->SetEnabledColor(text_color); | 118 import_link_->SetEnabledColor(text_color); |
117 } | 119 } |
OLD | NEW |