| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 UpdateColors(); | 97 UpdateColors(); |
| 98 } | 98 } |
| 99 | 99 |
| 100 void BookmarkBarInstructionsView::GetAccessibleState( | 100 void BookmarkBarInstructionsView::GetAccessibleState( |
| 101 ui::AXViewState* state) { | 101 ui::AXViewState* state) { |
| 102 instructions_->GetAccessibleState(state); | 102 instructions_->GetAccessibleState(state); |
| 103 } | 103 } |
| 104 | 104 |
| 105 void BookmarkBarInstructionsView::LinkClicked(views::Link* source, | 105 void BookmarkBarInstructionsView::LinkClicked(views::Link* source, |
| 106 int event_flags) { | 106 int event_flags) { |
| 107 delegate_->ShowImportDialog(); | 107 delegate_->OnImportLinkClicked(); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void BookmarkBarInstructionsView::ShowContextMenuForView( | 110 void BookmarkBarInstructionsView::ShowContextMenuForView( |
| 111 views::View* source, | 111 views::View* source, |
| 112 const gfx::Point& point, | 112 const gfx::Point& point, |
| 113 ui::MenuSourceType source_type) { | 113 ui::MenuSourceType source_type) { |
| 114 // Do nothing here, we don't want to show the Bookmarks context menu when | 114 // Do nothing here, we don't want to show the Bookmarks context menu when |
| 115 // the user right clicks on the "Import bookmarks now" link. | 115 // the user right clicks on the "Import bookmarks now" link. |
| 116 } | 116 } |
| 117 | 117 |
| 118 void BookmarkBarInstructionsView::UpdateColors() { | 118 void BookmarkBarInstructionsView::UpdateColors() { |
| 119 // We don't always have a theme provider (ui tests, for example). | 119 // We don't always have a theme provider (ui tests, for example). |
| 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 |