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

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

Issue 2374803002: Remove a bunch of pre-MD toolbar code and assets. (Closed)
Patch Set: fix mac? Created 4 years, 2 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 "content/public/browser/notification_source.h" 17 #include "content/public/browser/notification_source.h"
18 #include "ui/accessibility/ax_view_state.h" 18 #include "ui/accessibility/ax_view_state.h"
19 #include "ui/base/material_design/material_design_controller.h"
20 #include "ui/base/resource/resource_bundle.h" 19 #include "ui/base/resource/resource_bundle.h"
21 #include "ui/base/theme_provider.h" 20 #include "ui/base/theme_provider.h"
22 #include "ui/compositor/paint_recorder.h" 21 #include "ui/compositor/paint_recorder.h"
23 #include "ui/events/event.h" 22 #include "ui/events/event.h"
24 #include "ui/gfx/image/image_skia.h" 23 #include "ui/gfx/image/image_skia.h"
25 #include "ui/gfx/image/image_skia_operations.h" 24 #include "ui/gfx/image/image_skia_operations.h"
26 #include "ui/gfx/image/image_skia_source.h" 25 #include "ui/gfx/image/image_skia_source.h"
27 #include "ui/views/controls/button/label_button_border.h" 26 #include "ui/views/controls/button/label_button_border.h"
28 #include "ui/views/controls/menu/menu_controller.h" 27 #include "ui/views/controls/menu/menu_controller.h"
29 #include "ui/views/controls/menu/menu_model_adapter.h" 28 #include "ui/views/controls/menu/menu_model_adapter.h"
(...skipping 17 matching lines...) Expand all
47 ToolbarActionView::ToolbarActionView( 46 ToolbarActionView::ToolbarActionView(
48 ToolbarActionViewController* view_controller, 47 ToolbarActionViewController* view_controller,
49 ToolbarActionView::Delegate* delegate) 48 ToolbarActionView::Delegate* delegate)
50 : MenuButton(base::string16(), this, false), 49 : MenuButton(base::string16(), this, false),
51 view_controller_(view_controller), 50 view_controller_(view_controller),
52 delegate_(delegate), 51 delegate_(delegate),
53 called_register_command_(false), 52 called_register_command_(false),
54 wants_to_run_(false), 53 wants_to_run_(false),
55 menu_(nullptr), 54 menu_(nullptr),
56 weak_factory_(this) { 55 weak_factory_(this) {
57 if (ui::MaterialDesignController::IsModeMaterial()) { 56 SetInkDropMode(InkDropMode::ON);
58 SetInkDropMode(InkDropMode::ON); 57 SetFocusPainter(nullptr);
59 SetFocusPainter(nullptr);
60 }
61 set_has_ink_drop_action_on_click(true); 58 set_has_ink_drop_action_on_click(true);
62 set_id(VIEW_ID_BROWSER_ACTION); 59 set_id(VIEW_ID_BROWSER_ACTION);
63 view_controller_->SetDelegate(this); 60 view_controller_->SetDelegate(this);
64 SetHorizontalAlignment(gfx::ALIGN_CENTER); 61 SetHorizontalAlignment(gfx::ALIGN_CENTER);
65 set_drag_controller(delegate_); 62 set_drag_controller(delegate_);
66 63
67 set_context_menu_controller(this); 64 set_context_menu_controller(this);
68 65
69 // If the button is within a menu, we need to make it focusable in order to 66 // If the button is within a menu, we need to make it focusable in order to
70 // have it accessible via keyboard navigation. 67 // have it accessible via keyboard navigation.
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 if (menu_controller->in_nested_run()) { 308 if (menu_controller->in_nested_run()) {
312 // There is another menu showing. Close the outermost menu (since we are 309 // There is another menu showing. Close the outermost menu (since we are
313 // shown in the same menu, we don't want to close the whole thing). 310 // shown in the same menu, we don't want to close the whole thing).
314 menu_controller->Cancel(views::MenuController::EXIT_OUTERMOST); 311 menu_controller->Cancel(views::MenuController::EXIT_OUTERMOST);
315 return true; 312 return true;
316 } 313 }
317 } 314 }
318 315
319 return false; 316 return false;
320 } 317 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698