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 21 matching lines...) Expand all Loading... |
32 #include "ui/views/painter.h" | 32 #include "ui/views/painter.h" |
33 | 33 |
34 // static | 34 // static |
35 bool AppMenuButton::g_open_app_immediately_for_testing = false; | 35 bool AppMenuButton::g_open_app_immediately_for_testing = false; |
36 | 36 |
37 AppMenuButton::AppMenuButton(ToolbarView* toolbar_view) | 37 AppMenuButton::AppMenuButton(ToolbarView* toolbar_view) |
38 : views::MenuButton(NULL, base::string16(), toolbar_view, false), | 38 : views::MenuButton(NULL, base::string16(), toolbar_view, false), |
39 severity_(AppMenuIconPainter::SEVERITY_NONE), | 39 severity_(AppMenuIconPainter::SEVERITY_NONE), |
40 ink_drop_animation_controller_( | 40 ink_drop_animation_controller_( |
41 views::InkDropAnimationControllerFactory:: | 41 views::InkDropAnimationControllerFactory:: |
42 CreateInkDropAnimationController(this)), | 42 CreateInkDropAnimationController(this, this)), |
43 toolbar_view_(toolbar_view), | 43 toolbar_view_(toolbar_view), |
44 allow_extension_dragging_( | 44 allow_extension_dragging_( |
45 extensions::FeatureSwitch::extension_action_redesign() | 45 extensions::FeatureSwitch::extension_action_redesign() |
46 ->IsEnabled()), | 46 ->IsEnabled()), |
47 destroyed_(nullptr), | 47 destroyed_(nullptr), |
48 weak_factory_(this) { | 48 weak_factory_(this) { |
49 if (!ui::MaterialDesignController::IsModeMaterial()) | 49 if (!ui::MaterialDesignController::IsModeMaterial()) |
50 icon_painter_.reset(new AppMenuIconPainter(this)); | 50 icon_painter_.reset(new AppMenuIconPainter(this)); |
51 | 51 |
52 const int kInkDropLargeSize = 32; | 52 const int kInkDropLargeSize = 32; |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 return ui::DragDropTypes::DRAG_MOVE; | 261 return ui::DragDropTypes::DRAG_MOVE; |
262 } | 262 } |
263 | 263 |
264 void AppMenuButton::OnPaint(gfx::Canvas* canvas) { | 264 void AppMenuButton::OnPaint(gfx::Canvas* canvas) { |
265 views::MenuButton::OnPaint(canvas); | 265 views::MenuButton::OnPaint(canvas); |
266 if (ui::MaterialDesignController::IsModeMaterial()) | 266 if (ui::MaterialDesignController::IsModeMaterial()) |
267 return; | 267 return; |
268 icon_painter_->Paint(canvas, GetThemeProvider(), gfx::Rect(size()), | 268 icon_painter_->Paint(canvas, GetThemeProvider(), gfx::Rect(size()), |
269 AppMenuIconPainter::BEZEL_NONE); | 269 AppMenuIconPainter::BEZEL_NONE); |
270 } | 270 } |
OLD | NEW |