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

Side by Side Diff: chrome/browser/ui/views/toolbar/app_menu_button.cc

Issue 1460733002: Updates to overrides of InkDropHost::AddInkDropLayer() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/toolbar/app_menu_button.h" 5 #include "chrome/browser/ui/views/toolbar/app_menu_button.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/single_thread_task_runner.h" 8 #include "base/single_thread_task_runner.h"
9 #include "base/thread_task_runner_handle.h" 9 #include "base/thread_task_runner_handle.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 176
177 // TODO(estade): find a home for this constant. 177 // TODO(estade): find a home for this constant.
178 const int kButtonSize = 16; 178 const int kButtonSize = 16;
179 SetImage(views::Button::STATE_NORMAL, 179 SetImage(views::Button::STATE_NORMAL,
180 gfx::CreateVectorIcon(gfx::VectorIconId::BROWSER_TOOLS, kButtonSize, 180 gfx::CreateVectorIcon(gfx::VectorIconId::BROWSER_TOOLS, kButtonSize,
181 color)); 181 color));
182 } 182 }
183 183
184 void AppMenuButton::AddInkDropLayer(ui::Layer* ink_drop_layer) { 184 void AppMenuButton::AddInkDropLayer(ui::Layer* ink_drop_layer) {
185 SetPaintToLayer(true); 185 SetPaintToLayer(true);
186 SetFillsBoundsOpaquely(false);
186 image()->SetPaintToLayer(true); 187 image()->SetPaintToLayer(true);
187 image()->SetFillsBoundsOpaquely(false); 188 image()->SetFillsBoundsOpaquely(false);
188 189
189 layer()->Add(ink_drop_layer); 190 layer()->Add(ink_drop_layer);
190 layer()->StackAtBottom(ink_drop_layer); 191 layer()->StackAtBottom(ink_drop_layer);
191 } 192 }
192 193
193 void AppMenuButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { 194 void AppMenuButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) {
194 layer()->Remove(ink_drop_layer); 195 layer()->Remove(ink_drop_layer);
195 196
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 return ui::DragDropTypes::DRAG_MOVE; 262 return ui::DragDropTypes::DRAG_MOVE;
262 } 263 }
263 264
264 void AppMenuButton::OnPaint(gfx::Canvas* canvas) { 265 void AppMenuButton::OnPaint(gfx::Canvas* canvas) {
265 views::MenuButton::OnPaint(canvas); 266 views::MenuButton::OnPaint(canvas);
266 if (ui::MaterialDesignController::IsModeMaterial()) 267 if (ui::MaterialDesignController::IsModeMaterial())
267 return; 268 return;
268 icon_painter_->Paint(canvas, GetThemeProvider(), gfx::Rect(size()), 269 icon_painter_->Paint(canvas, GetThemeProvider(), gfx::Rect(size()),
269 AppMenuIconPainter::BEZEL_NONE); 270 AppMenuIconPainter::BEZEL_NONE);
270 } 271 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698