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 <atlbase.h> | 5 #include <atlbase.h> |
6 #include <atlapp.h> | 6 #include <atlapp.h> |
7 | 7 |
8 #include "chrome/views/menu_button.h" | 8 #include "chrome/views/menu_button.h" |
9 | 9 |
10 #include "chrome/app/theme/theme_resources.h" | 10 #include "chrome/app/theme/theme_resources.h" |
11 #include "chrome/common/drag_drop_types.h" | 11 #include "chrome/common/drag_drop_types.h" |
12 #include "chrome/common/gfx/chrome_canvas.h" | 12 #include "chrome/common/gfx/chrome_canvas.h" |
13 #include "chrome/common/l10n_util.h" | 13 #include "chrome/common/l10n_util.h" |
14 #include "chrome/common/resource_bundle.h" | 14 #include "chrome/common/resource_bundle.h" |
15 #include "chrome/common/win_util.h" | 15 #include "chrome/common/win_util.h" |
16 #include "chrome/views/button.h" | 16 #include "chrome/views/button.h" |
17 #include "chrome/views/container.h" | 17 #include "chrome/views/container.h" |
18 #include "chrome/views/event.h" | 18 #include "chrome/views/event.h" |
19 #include "chrome/views/root_view.h" | 19 #include "chrome/views/root_view.h" |
20 #include "chrome/views/view_menu_delegate.h" | 20 #include "chrome/views/view_menu_delegate.h" |
21 | 21 |
22 #include "generated_resources.h" | 22 #include "generated_resources.h" |
23 | 23 |
| 24 using base::Time; |
| 25 using base::TimeDelta; |
| 26 |
24 namespace views { | 27 namespace views { |
25 | 28 |
26 // The amount of time, in milliseconds, we wait before allowing another mouse | 29 // The amount of time, in milliseconds, we wait before allowing another mouse |
27 // pressed event to show the menu. | 30 // pressed event to show the menu. |
28 static const int64 kMinimumTimeBetweenButtonClicks = 100; | 31 static const int64 kMinimumTimeBetweenButtonClicks = 100; |
29 | 32 |
30 // The down arrow used to differentiate the menu button from normal | 33 // The down arrow used to differentiate the menu button from normal |
31 // text buttons. | 34 // text buttons. |
32 static const SkBitmap* kMenuMarker = NULL; | 35 static const SkBitmap* kMenuMarker = NULL; |
33 | 36 |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 // to BS_NORMAL instead of keeping the state BM_PUSHED. This, in turn, will | 251 // to BS_NORMAL instead of keeping the state BM_PUSHED. This, in turn, will |
249 // cause the button to appear depressed while the menu is displayed. | 252 // cause the button to appear depressed while the menu is displayed. |
250 void MenuButton::OnMouseExited(const MouseEvent& event) { | 253 void MenuButton::OnMouseExited(const MouseEvent& event) { |
251 if ((state_ != BS_DISABLED) && (!menu_visible_) && (!InDrag())) { | 254 if ((state_ != BS_DISABLED) && (!menu_visible_) && (!InDrag())) { |
252 SetState(BS_NORMAL); | 255 SetState(BS_NORMAL); |
253 } | 256 } |
254 } | 257 } |
255 | 258 |
256 } // namespace views | 259 } // namespace views |
257 | 260 |
OLD | NEW |