OLD | NEW |
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 #include "views/controls/button/button_dropdown.h" | 5 #include "views/controls/button/button_dropdown.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/compiler_specific.h" |
8 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
9 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
10 #include "views/controls/menu/view_menu_delegate.h" | 11 #include "views/controls/menu/view_menu_delegate.h" |
11 #include "views/widget/widget.h" | 12 #include "views/widget/widget.h" |
12 | 13 |
13 namespace views { | 14 namespace views { |
14 | 15 |
15 // How long to wait before showing the menu | 16 // How long to wait before showing the menu |
16 static const int kMenuTimerDelay = 500; | 17 static const int kMenuTimerDelay = 500; |
17 | 18 |
18 //////////////////////////////////////////////////////////////////////////////// | 19 //////////////////////////////////////////////////////////////////////////////// |
19 // | 20 // |
20 // ButtonDropDown - constructors, destructors, initialization, cleanup | 21 // ButtonDropDown - constructors, destructors, initialization, cleanup |
21 // | 22 // |
22 //////////////////////////////////////////////////////////////////////////////// | 23 //////////////////////////////////////////////////////////////////////////////// |
23 | 24 |
24 ButtonDropDown::ButtonDropDown(ButtonListener* listener, | 25 ButtonDropDown::ButtonDropDown(ButtonListener* listener, |
25 Menu::Delegate* menu_delegate) | 26 Menu::Delegate* menu_delegate) |
26 : ImageButton(listener), | 27 : ImageButton(listener), |
27 menu_delegate_(menu_delegate), | 28 menu_delegate_(menu_delegate), |
28 y_position_on_lbuttondown_(0), | 29 y_position_on_lbuttondown_(0), |
29 show_menu_factory_(this) { | 30 ALLOW_THIS_IN_INITIALIZER_LIST(show_menu_factory_(this)) { |
30 } | 31 } |
31 | 32 |
32 ButtonDropDown::~ButtonDropDown() { | 33 ButtonDropDown::~ButtonDropDown() { |
33 } | 34 } |
34 | 35 |
35 //////////////////////////////////////////////////////////////////////////////// | 36 //////////////////////////////////////////////////////////////////////////////// |
36 // | 37 // |
37 // ButtonDropDown - Events | 38 // ButtonDropDown - Events |
38 // | 39 // |
39 //////////////////////////////////////////////////////////////////////////////// | 40 //////////////////////////////////////////////////////////////////////////////// |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 } | 184 } |
184 | 185 |
185 bool ButtonDropDown::GetAccessibleState(AccessibilityTypes::State* state) { | 186 bool ButtonDropDown::GetAccessibleState(AccessibilityTypes::State* state) { |
186 DCHECK(state); | 187 DCHECK(state); |
187 | 188 |
188 *state = AccessibilityTypes::STATE_HASPOPUP; | 189 *state = AccessibilityTypes::STATE_HASPOPUP; |
189 return true; | 190 return true; |
190 } | 191 } |
191 | 192 |
192 } // namespace views | 193 } // namespace views |
OLD | NEW |