Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3784)

Unified Diff: chrome/browser/ui/views/find_bar_view.cc

Issue 2744463002: Add VectorIconButton functionality to ImageButton. (Closed)
Patch Set: check details Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/find_bar_view.h ('k') | chrome/browser/ui/views/infobars/infobar_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/find_bar_view.cc
diff --git a/chrome/browser/ui/views/find_bar_view.cc b/chrome/browser/ui/views/find_bar_view.cc
index 6aa3f49774467a369a49f16809fa17f5d9217fee..8f149b8956325b2ad49fadb66fa1588626f8bb0d 100644
--- a/chrome/browser/ui/views/find_bar_view.cc
+++ b/chrome/browser/ui/views/find_bar_view.cc
@@ -36,7 +36,7 @@
#include "ui/views/border.h"
#include "ui/views/bubble/bubble_border.h"
#include "ui/views/controls/button/image_button.h"
-#include "ui/views/controls/button/vector_icon_button.h"
+#include "ui/views/controls/button/image_button_factory.h"
#include "ui/views/controls/label.h"
#include "ui/views/controls/separator.h"
#include "ui/views/layout/box_layout.h"
@@ -117,9 +117,9 @@ FindBarView::FindBarView(FindBarHost* host)
match_count_text_(new MatchCountLabel()),
focus_forwarder_view_(new FocusForwarderView(find_text_)),
separator_(new views::Separator()),
- find_previous_button_(new views::VectorIconButton(this)),
- find_next_button_(new views::VectorIconButton(this)),
- close_button_(new views::VectorIconButton(this)) {
+ find_previous_button_(views::CreateVectorImageButton(this)),
+ find_next_button_(views::CreateVectorImageButton(this)),
+ close_button_(views::CreateVectorImageButton(this)) {
find_text_->set_id(VIEW_ID_FIND_IN_PAGE_TEXT_FIELD);
find_text_->set_default_width_in_chars(kDefaultCharWidth);
find_text_->set_controller(this);
@@ -127,10 +127,6 @@ FindBarView::FindBarView(FindBarHost* host)
find_text_->SetTextInputFlags(ui::TEXT_INPUT_FLAG_AUTOCORRECT_OFF);
AddChildView(find_text_);
- find_previous_button_->SetIcon(kCaretUpIcon);
- find_next_button_->SetIcon(kCaretDownIcon);
- close_button_->SetIcon(ui::kCloseIcon);
-
find_previous_button_->set_id(VIEW_ID_FIND_IN_PAGE_PREVIOUS_BUTTON);
find_previous_button_->SetFocusForPlatform();
find_previous_button_->SetTooltipText(
@@ -280,7 +276,7 @@ void FindBarView::SetFocusAndSelection(bool select_all) {
}
////////////////////////////////////////////////////////////////////////////////
-// FindBarView, views::VectorIconButtonDelegate implementation:
+// FindBarView, views::ButtonListener implementation:
void FindBarView::ButtonPressed(
views::Button* sender, const ui::Event& event) {
@@ -307,11 +303,6 @@ void FindBarView::ButtonPressed(
}
}
-SkColor FindBarView::GetVectorIconBaseColor() const {
- return GetNativeTheme()->GetSystemColor(
- ui::NativeTheme::kColorId_TextfieldDefaultColor);
-}
-
////////////////////////////////////////////////////////////////////////////////
// FindBarView, views::TextfieldController implementation:
@@ -422,5 +413,12 @@ void FindBarView::OnNativeThemeChanged(const ui::NativeTheme* theme) {
theme->GetSystemColor(ui::NativeTheme::kColorId_TextfieldDefaultColor);
match_count_text_->SetEnabledColor(SkColorSetA(text_color, 0x69));
separator_->SetColor(SkColorSetA(text_color, 0x26));
-}
+ const SkColor base_icon_color = GetNativeTheme()->GetSystemColor(
+ ui::NativeTheme::kColorId_TextfieldDefaultColor);
+ views::SetImageFromVectorIcon(find_previous_button_, kCaretUpIcon,
+ base_icon_color);
+ views::SetImageFromVectorIcon(find_next_button_, kCaretDownIcon,
+ base_icon_color);
+ views::SetImageFromVectorIcon(close_button_, ui::kCloseIcon, base_icon_color);
+}
« no previous file with comments | « chrome/browser/ui/views/find_bar_view.h ('k') | chrome/browser/ui/views/infobars/infobar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698