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

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

Issue 1411833006: Refactoring to make adding ink drop animations easier (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Attempt to refactor ink drop animations (wired up chained EventHandler) Created 5 years, 1 month 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/gfx/geometry/point.h" 9 #include "ui/gfx/geometry/point.h"
10 #include "ui/views/animation/ink_drop_host.h" 10 #include "ui/views/animation/ink_drop_host.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // views::LabelButton: 66 // views::LabelButton:
67 bool ShouldEnterPushedState(const ui::Event& event) override; 67 bool ShouldEnterPushedState(const ui::Event& event) override;
68 void NotifyClick(const ui::Event& event) override; 68 void NotifyClick(const ui::Event& event) override;
69 69
70 // Returns if menu should be shown. Override this to change default behavior. 70 // Returns if menu should be shown. Override this to change default behavior.
71 virtual bool ShouldShowMenu(); 71 virtual bool ShouldShowMenu();
72 72
73 // Function to show the dropdown menu. 73 // Function to show the dropdown menu.
74 virtual void ShowDropDownMenu(ui::MenuSourceType source_type); 74 virtual void ShowDropDownMenu(ui::MenuSourceType source_type);
75 75
76 // Returns the Point where the ink drop should be centered. 76 // views::InkDropHost:
77 virtual gfx::Point CalculateInkDropCenter() const; 77 gfx::Point CalculateInkDropCenter() const override;
78 78
79 views::InkDropAnimationController* ink_drop_animation_controller() { 79 views::InkDropAnimationController* ink_drop_animation_controller() {
80 return ink_drop_animation_controller_.get(); 80 return ink_drop_animation_controller_.get();
81 } 81 }
82 82
83 private: 83 private:
84 // views::LabelButton: 84 // views::LabelButton:
85 const char* GetClassName() const override; 85 const char* GetClassName() const override;
86 86
87 // The model that populates the attached menu. 87 // The model that populates the attached menu.
(...skipping 11 matching lines...) Expand all
99 // Animation controller for the ink drop ripple effect. 99 // Animation controller for the ink drop ripple effect.
100 scoped_ptr<views::InkDropAnimationController> ink_drop_animation_controller_; 100 scoped_ptr<views::InkDropAnimationController> ink_drop_animation_controller_;
101 101
102 // A factory for tasks that show the dropdown context menu for the button. 102 // A factory for tasks that show the dropdown context menu for the button.
103 base::WeakPtrFactory<ToolbarButton> show_menu_factory_; 103 base::WeakPtrFactory<ToolbarButton> show_menu_factory_;
104 104
105 DISALLOW_COPY_AND_ASSIGN(ToolbarButton); 105 DISALLOW_COPY_AND_ASSIGN(ToolbarButton);
106 }; 106 };
107 107
108 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_BUTTON_H_ 108 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_BUTTON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698