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

Side by Side Diff: chrome/browser/ui/views/toolbar/toolbar_button.h

Issue 1298513003: Implemented prototype for new ink drop specs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed outstanding concerns and improved documentation. Created 5 years, 3 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 #ifndef CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_BUTTON_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_BUTTON_H_
6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_BUTTON_H_ 6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_BUTTON_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "ui/views/animation/ink_drop_host.h" 9 #include "ui/views/animation/ink_drop_host.h"
10 #include "ui/views/context_menu_controller.h" 10 #include "ui/views/context_menu_controller.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 void AddInkDropLayer(ui::Layer* ink_drop_layer) override; 61 void AddInkDropLayer(ui::Layer* ink_drop_layer) override;
62 void RemoveInkDropLayer(ui::Layer* ink_drop_layer) override; 62 void RemoveInkDropLayer(ui::Layer* ink_drop_layer) override;
63 63
64 protected: 64 protected:
65 // Overridden from CustomButton. Returns true if the button should become 65 // Overridden from CustomButton. Returns true if the button should become
66 // pressed when a user holds the mouse down over the button. For this 66 // pressed when a user holds the mouse down over the button. For this
67 // implementation, both left and right mouse buttons can trigger a change 67 // implementation, both left and right mouse buttons can trigger a change
68 // to the PUSHED state. 68 // to the PUSHED state.
69 bool ShouldEnterPushedState(const ui::Event& event) override; 69 bool ShouldEnterPushedState(const ui::Event& event) override;
70 70
71 // views::LabelButton:
72 void NotifyClick(const ui::Event& event) override;
Peter Kasting 2015/09/03 21:53:06 Nit: No subclasses need to call this, so make this
bruthig 2015/09/09 18:00:36 Incorrect, HomeButton::OnNotifyClick() calls Toolb
73
71 // Returns if menu should be shown. Override this to change default behavior. 74 // Returns if menu should be shown. Override this to change default behavior.
72 virtual bool ShouldShowMenu(); 75 virtual bool ShouldShowMenu();
73 76
74 // Function to show the dropdown menu. 77 // Function to show the dropdown menu.
75 virtual void ShowDropDownMenu(ui::MenuSourceType source_type); 78 virtual void ShowDropDownMenu(ui::MenuSourceType source_type);
76 79
77 virtual void LayoutInkDrop(); 80 virtual void LayoutInkDrop();
78 81
79 views::InkDropAnimationController* ink_drop_animation_controller() { 82 views::InkDropAnimationController* ink_drop_animation_controller() {
80 return ink_drop_animation_controller_.get(); 83 return ink_drop_animation_controller_.get();
(...skipping 18 matching lines...) Expand all
99 // Animation controller for the ink drop ripple effect. 102 // Animation controller for the ink drop ripple effect.
100 scoped_ptr<views::InkDropAnimationController> ink_drop_animation_controller_; 103 scoped_ptr<views::InkDropAnimationController> ink_drop_animation_controller_;
101 104
102 // A factory for tasks that show the dropdown context menu for the button. 105 // A factory for tasks that show the dropdown context menu for the button.
103 base::WeakPtrFactory<ToolbarButton> show_menu_factory_; 106 base::WeakPtrFactory<ToolbarButton> show_menu_factory_;
104 107
105 DISALLOW_COPY_AND_ASSIGN(ToolbarButton); 108 DISALLOW_COPY_AND_ASSIGN(ToolbarButton);
106 }; 109 };
107 110
108 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_BUTTON_H_ 111 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_BUTTON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698