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

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

Issue 2069733002: MD - Use real comboboxes in website settings popup. Hide borders (but (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comment Created 4 years, 6 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 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/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 25 matching lines...) Expand all
36 36
37 AppMenuButton::AppMenuButton(ToolbarView* toolbar_view) 37 AppMenuButton::AppMenuButton(ToolbarView* toolbar_view)
38 : views::MenuButton(base::string16(), toolbar_view, false), 38 : views::MenuButton(base::string16(), toolbar_view, false),
39 severity_(AppMenuIconPainter::SEVERITY_NONE), 39 severity_(AppMenuIconPainter::SEVERITY_NONE),
40 type_(AppMenuIconController::IconType::NONE), 40 type_(AppMenuIconController::IconType::NONE),
41 toolbar_view_(toolbar_view), 41 toolbar_view_(toolbar_view),
42 allow_extension_dragging_( 42 allow_extension_dragging_(
43 extensions::FeatureSwitch::extension_action_redesign()->IsEnabled()), 43 extensions::FeatureSwitch::extension_action_redesign()->IsEnabled()),
44 margin_trailing_(0), 44 margin_trailing_(0),
45 weak_factory_(this) { 45 weak_factory_(this) {
46 if (ui::MaterialDesignController::IsModeMaterial()) 46 if (ui::MaterialDesignController::IsModeMaterial()) {
47 SetHasInkDrop(true); 47 SetHasInkDrop(true);
48 else 48 SetFocusPainter(nullptr);
49 } else {
49 icon_painter_.reset(new AppMenuIconPainter(this)); 50 icon_painter_.reset(new AppMenuIconPainter(this));
51 }
50 } 52 }
51 53
52 AppMenuButton::~AppMenuButton() {} 54 AppMenuButton::~AppMenuButton() {}
53 55
54 void AppMenuButton::SetSeverity(AppMenuIconController::IconType type, 56 void AppMenuButton::SetSeverity(AppMenuIconController::IconType type,
55 AppMenuIconPainter::Severity severity, 57 AppMenuIconPainter::Severity severity,
56 bool animate) { 58 bool animate) {
57 if (ui::MaterialDesignController::IsModeMaterial()) { 59 if (ui::MaterialDesignController::IsModeMaterial()) {
58 severity_ = severity; 60 severity_ = severity;
59 type_ = type; 61 type_ = type;
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 views::MenuButton::OnPaint(canvas); 268 views::MenuButton::OnPaint(canvas);
267 if (ui::MaterialDesignController::IsModeMaterial()) 269 if (ui::MaterialDesignController::IsModeMaterial())
268 return; 270 return;
269 // Use GetPreferredSize() to center the icon inside the visible bounds rather 271 // Use GetPreferredSize() to center the icon inside the visible bounds rather
270 // than the whole size() (which may refer to hit test region extended to the 272 // than the whole size() (which may refer to hit test region extended to the
271 // end of the toolbar in maximized mode). 273 // end of the toolbar in maximized mode).
272 icon_painter_->Paint(canvas, GetThemeProvider(), 274 icon_painter_->Paint(canvas, GetThemeProvider(),
273 gfx::Rect(GetPreferredSize()), 275 gfx::Rect(GetPreferredSize()),
274 AppMenuIconPainter::BEZEL_NONE); 276 AppMenuIconPainter::BEZEL_NONE);
275 } 277 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc ('k') | chrome/browser/ui/views/toolbar/toolbar_action_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698