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

Side by Side Diff: chrome/views/controls/button/custom_button.h

Issue 17428: Issue 358: Can't open a new tab by middle-clicking home button... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/views/toolbar_view.cc ('k') | chrome/views/controls/button/custom_button.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ 5 #ifndef CHROME_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_
6 #define CHROME_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ 6 #define CHROME_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_
7 7
8 #include "chrome/common/animation.h" 8 #include "chrome/common/animation.h"
9 #include "chrome/views/controls/button/button.h" 9 #include "chrome/views/controls/button/button.h"
10 10
(...skipping 25 matching lines...) Expand all
36 void StartThrobbing(int cycles_til_stop); 36 void StartThrobbing(int cycles_til_stop);
37 37
38 // Set how long the hover animation will last for. 38 // Set how long the hover animation will last for.
39 void SetAnimationDuration(int duration); 39 void SetAnimationDuration(int duration);
40 40
41 // Overridden from View: 41 // Overridden from View:
42 virtual void SetEnabled(bool enabled); 42 virtual void SetEnabled(bool enabled);
43 virtual bool IsEnabled() const; 43 virtual bool IsEnabled() const;
44 virtual bool IsFocusable() const; 44 virtual bool IsFocusable() const;
45 45
46 void set_triggerable_event_flags(int triggerable_event_flags) {
47 triggerable_event_flags_ = triggerable_event_flags;
48 }
49
50 int triggerable_event_flags() const {
51 return triggerable_event_flags_;
52 }
53
46 protected: 54 protected:
47 // Construct the Button with a Listener. See comment for Button's ctor. 55 // Construct the Button with a Listener. See comment for Button's ctor.
48 explicit CustomButton(ButtonListener* listener); 56 explicit CustomButton(ButtonListener* listener);
49 57
50 // Returns true if the event is one that can trigger notifying the listener. 58 // Returns true if the event is one that can trigger notifying the listener.
51 // This implementation returns true if the left mouse button is down. 59 // This implementation returns true if the left mouse button is down.
52 virtual bool IsTriggerableEvent(const MouseEvent& e); 60 virtual bool IsTriggerableEvent(const MouseEvent& e);
53 61
54 // Overridden from View: 62 // Overridden from View:
55 virtual bool AcceleratorPressed(const Accelerator& accelerator); 63 virtual bool AcceleratorPressed(const Accelerator& accelerator);
(...skipping 23 matching lines...) Expand all
79 void SetHighlighted(bool highlighted); 87 void SetHighlighted(bool highlighted);
80 bool IsHighlighted() const; 88 bool IsHighlighted() const;
81 89
82 // Returns whether the button is pushed. 90 // Returns whether the button is pushed.
83 bool IsPushed() const; 91 bool IsPushed() const;
84 92
85 // Should we animate when the state changes? Defaults to true, but false while 93 // Should we animate when the state changes? Defaults to true, but false while
86 // throbbing. 94 // throbbing.
87 bool animate_on_state_change_; 95 bool animate_on_state_change_;
88 96
97 // Mouse event flags which can trigger button actions.
98 int triggerable_event_flags_;
99
89 DISALLOW_COPY_AND_ASSIGN(CustomButton); 100 DISALLOW_COPY_AND_ASSIGN(CustomButton);
90 }; 101 };
91 102
92 } // namespace views 103 } // namespace views
93 104
94 #endif // CHROME_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ 105 #endif // CHROME_VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_
OLDNEW
« no previous file with comments | « chrome/browser/views/toolbar_view.cc ('k') | chrome/views/controls/button/custom_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698