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

Unified Diff: chrome/browser/ui/views/toolbar/toolbar_action_view.cc

Issue 2495213006: [top-chrome-md] Made extension buttons show the highlight when focused. (Closed)
Patch Set: Created 4 years, 1 month 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/toolbar/toolbar_action_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/toolbar/toolbar_action_view.cc
diff --git a/chrome/browser/ui/views/toolbar/toolbar_action_view.cc b/chrome/browser/ui/views/toolbar/toolbar_action_view.cc
index 9968433c774838f490295daa411611a248a00183..5225c601e2316576f675ce6eedcaef2292bd7485 100644
--- a/chrome/browser/ui/views/toolbar/toolbar_action_view.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_action_view.cc
@@ -23,6 +23,7 @@
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/image/image_skia_operations.h"
#include "ui/gfx/image/image_skia_source.h"
+#include "ui/views/animation/flood_fill_ink_drop_ripple.h"
#include "ui/views/animation/ink_drop_impl.h"
#include "ui/views/controls/button/label_button_border.h"
#include "ui/views/controls/menu/menu_controller.h"
@@ -110,9 +111,24 @@ std::unique_ptr<views::InkDrop> ToolbarActionView::CreateInkDrop() {
std::unique_ptr<views::InkDropImpl> ink_drop =
CustomButton::CreateDefaultInkDropImpl();
ink_drop->SetShowHighlightOnHover(!delegate_->ShownInsideMenu());
+ ink_drop->SetShowHighlightOnFocus(true);
return std::move(ink_drop);
}
+std::unique_ptr<views::InkDropRipple> ToolbarActionView::CreateInkDropRipple()
+ const {
+ if (delegate_->ShownInsideMenu()) {
+ // The ripple should not be visible when |this| is shown inside of a menu.
+ // TODO(bruthig): Use a lighter weight InkDropRipple type that doesn't
+ // consume as many the resources as the FloodFillInkDropRipple. See
+ // https://crbug.com/665214.
+ return base::MakeUnique<views::FloodFillInkDropRipple>(
+ gfx::Rect(), gfx::Point(), SK_ColorTRANSPARENT, 0.f);
Peter Kasting 2016/11/15 00:38:39 Can we just return null, and have the caller handl
bruthig 2016/11/15 01:25:12 Short answer, returning null is a possible long te
Peter Kasting 2016/11/15 01:47:36 I commented there about the overall route here. I
bruthig 2016/11/15 03:47:50 Done.
+ }
+
+ return MenuButton::CreateInkDropRipple();
+}
+
content::WebContents* ToolbarActionView::GetCurrentWebContents() const {
return delegate_->GetCurrentWebContents();
}
« no previous file with comments | « chrome/browser/ui/views/toolbar/toolbar_action_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698