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

Side by Side Diff: chrome/browser/ui/views/toolbar/toolbar_action_view.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: fix test 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/toolbar_action_view.h" 5 #include "chrome/browser/ui/views/toolbar/toolbar_action_view.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "chrome/browser/chrome_notification_types.h" 11 #include "chrome/browser/chrome_notification_types.h"
12 #include "chrome/browser/sessions/session_tab_helper.h" 12 #include "chrome/browser/sessions/session_tab_helper.h"
13 #include "chrome/browser/themes/theme_properties.h" 13 #include "chrome/browser/themes/theme_properties.h"
14 #include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h" 14 #include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h"
15 #include "chrome/browser/ui/toolbar/toolbar_actions_bar.h" 15 #include "chrome/browser/ui/toolbar/toolbar_actions_bar.h"
16 #include "chrome/browser/ui/view_ids.h" 16 #include "chrome/browser/ui/view_ids.h"
17 #include "chrome/grit/generated_resources.h" 17 #include "chrome/grit/generated_resources.h"
18 #include "content/public/browser/notification_source.h" 18 #include "content/public/browser/notification_source.h"
19 #include "grit/theme_resources.h" 19 #include "grit/theme_resources.h"
20 #include "ui/accessibility/ax_view_state.h" 20 #include "ui/accessibility/ax_view_state.h"
21 #include "ui/base/material_design/material_design_controller.h"
21 #include "ui/base/resource/resource_bundle.h" 22 #include "ui/base/resource/resource_bundle.h"
22 #include "ui/base/theme_provider.h" 23 #include "ui/base/theme_provider.h"
23 #include "ui/compositor/paint_recorder.h" 24 #include "ui/compositor/paint_recorder.h"
24 #include "ui/events/event.h" 25 #include "ui/events/event.h"
25 #include "ui/gfx/image/image_skia.h" 26 #include "ui/gfx/image/image_skia.h"
26 #include "ui/gfx/image/image_skia_operations.h" 27 #include "ui/gfx/image/image_skia_operations.h"
27 #include "ui/gfx/image/image_skia_source.h" 28 #include "ui/gfx/image/image_skia_source.h"
28 #include "ui/resources/grit/ui_resources.h" 29 #include "ui/resources/grit/ui_resources.h"
29 #include "ui/views/controls/button/label_button_border.h" 30 #include "ui/views/controls/button/label_button_border.h"
30 #include "ui/views/controls/menu/menu_controller.h" 31 #include "ui/views/controls/menu/menu_controller.h"
(...skipping 24 matching lines...) Expand all
55 ToolbarActionViewController* view_controller, 56 ToolbarActionViewController* view_controller,
56 ToolbarActionView::Delegate* delegate) 57 ToolbarActionView::Delegate* delegate)
57 : MenuButton(base::string16(), this, false), 58 : MenuButton(base::string16(), this, false),
58 view_controller_(view_controller), 59 view_controller_(view_controller),
59 delegate_(delegate), 60 delegate_(delegate),
60 called_register_command_(false), 61 called_register_command_(false),
61 wants_to_run_(false), 62 wants_to_run_(false),
62 menu_(nullptr), 63 menu_(nullptr),
63 weak_factory_(this) { 64 weak_factory_(this) {
64 SetHasInkDrop(true); 65 SetHasInkDrop(true);
66 if (ui::MaterialDesignController::IsModeMaterial())
msw 2016/06/15 19:52:38 nit: order after set_has_ink_drop_action_on_click,
67 SetFocusPainter(nullptr);
65 set_has_ink_drop_action_on_click(true); 68 set_has_ink_drop_action_on_click(true);
66 set_id(VIEW_ID_BROWSER_ACTION); 69 set_id(VIEW_ID_BROWSER_ACTION);
67 view_controller_->SetDelegate(this); 70 view_controller_->SetDelegate(this);
68 SetHorizontalAlignment(gfx::ALIGN_CENTER); 71 SetHorizontalAlignment(gfx::ALIGN_CENTER);
69 set_drag_controller(delegate_); 72 set_drag_controller(delegate_);
70 73
71 set_context_menu_controller(this); 74 set_context_menu_controller(this);
72 75
73 // If the button is within a menu, we need to make it focusable in order to 76 // If the button is within a menu, we need to make it focusable in order to
74 // have it accessible via keyboard navigation. 77 // have it accessible via keyboard navigation.
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 if (menu_controller->in_nested_run()) { 321 if (menu_controller->in_nested_run()) {
319 // There is another menu showing. Close the outermost menu (since we are 322 // There is another menu showing. Close the outermost menu (since we are
320 // shown in the same menu, we don't want to close the whole thing). 323 // shown in the same menu, we don't want to close the whole thing).
321 menu_controller->Cancel(views::MenuController::EXIT_OUTERMOST); 324 menu_controller->Cancel(views::MenuController::EXIT_OUTERMOST);
322 return true; 325 return true;
323 } 326 }
324 } 327 }
325 328
326 return false; 329 return false;
327 } 330 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698