| 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 "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/defaults.h" | 8 #include "chrome/browser/defaults.h" |
| 9 #include "chrome/browser/themes/theme_service.h" | 9 #include "chrome/browser/themes/theme_service.h" |
| 10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 baseline_(-1), | 26 baseline_(-1), |
| 27 updated_colors_(false) { | 27 updated_colors_(false) { |
| 28 instructions_ = new views::Label( | 28 instructions_ = new views::Label( |
| 29 UTF16ToWide(l10n_util::GetStringUTF16(IDS_BOOKMARKS_NO_ITEMS))); | 29 UTF16ToWide(l10n_util::GetStringUTF16(IDS_BOOKMARKS_NO_ITEMS))); |
| 30 AddChildView(instructions_); | 30 AddChildView(instructions_); |
| 31 | 31 |
| 32 if (browser_defaults::kShowImportOnBookmarkBar) { | 32 if (browser_defaults::kShowImportOnBookmarkBar) { |
| 33 import_link_ = new views::Link( | 33 import_link_ = new views::Link( |
| 34 UTF16ToWide(l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_IMPORT_LINK))); | 34 UTF16ToWide(l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_IMPORT_LINK))); |
| 35 // We don't want the link to alter tab navigation. | 35 // We don't want the link to alter tab navigation. |
| 36 import_link_->SetFocusable(false); | 36 import_link_->set_focusable(false); |
| 37 import_link_->set_listener(this); | 37 import_link_->set_listener(this); |
| 38 AddChildView(import_link_); | 38 AddChildView(import_link_); |
| 39 } | 39 } |
| 40 } | 40 } |
| 41 | 41 |
| 42 gfx::Size BookmarkBarInstructionsView::GetPreferredSize() { | 42 gfx::Size BookmarkBarInstructionsView::GetPreferredSize() { |
| 43 int ascent = 0, descent = 0, height = 0, width = 0; | 43 int ascent = 0, descent = 0, height = 0, width = 0; |
| 44 for (int i = 0; i < child_count(); ++i) { | 44 for (int i = 0; i < child_count(); ++i) { |
| 45 views::View* view = GetChildViewAt(i); | 45 views::View* view = GetChildViewAt(i); |
| 46 gfx::Size pref = view->GetPreferredSize(); | 46 gfx::Size pref = view->GetPreferredSize(); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 const ui::ThemeProvider* theme_provider = GetThemeProvider(); | 104 const ui::ThemeProvider* theme_provider = GetThemeProvider(); |
| 105 if (!theme_provider) | 105 if (!theme_provider) |
| 106 return; | 106 return; |
| 107 updated_colors_ = true; | 107 updated_colors_ = true; |
| 108 SkColor text_color = | 108 SkColor text_color = |
| 109 theme_provider->GetColor(ThemeService::COLOR_BOOKMARK_TEXT); | 109 theme_provider->GetColor(ThemeService::COLOR_BOOKMARK_TEXT); |
| 110 instructions_->SetColor(text_color); | 110 instructions_->SetColor(text_color); |
| 111 if (import_link_) | 111 if (import_link_) |
| 112 import_link_->SetColor(text_color); | 112 import_link_->SetColor(text_color); |
| 113 } | 113 } |
| OLD | NEW |