OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |