OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/menu/menu_controller.h" | 5 #include "views/controls/menu/menu_controller.h" |
6 | 6 |
7 #include "app/keyboard_codes.h" | 7 #include "app/keyboard_codes.h" |
8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
9 #include "app/os_exchange_data.h" | |
10 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
11 #include "base/time.h" | 10 #include "base/time.h" |
12 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
13 #include "gfx/canvas_skia.h" | 12 #include "gfx/canvas_skia.h" |
| 13 #include "ui/base/dragdrop/os_exchange_data.h" |
14 #include "views/controls/button/menu_button.h" | 14 #include "views/controls/button/menu_button.h" |
15 #include "views/controls/menu/menu_scroll_view_container.h" | 15 #include "views/controls/menu/menu_scroll_view_container.h" |
16 #include "views/controls/menu/submenu_view.h" | 16 #include "views/controls/menu/submenu_view.h" |
17 #include "views/drag_utils.h" | 17 #include "views/drag_utils.h" |
18 #include "views/screen.h" | 18 #include "views/screen.h" |
19 #include "views/view_constants.h" | 19 #include "views/view_constants.h" |
20 #include "views/views_delegate.h" | 20 #include "views/views_delegate.h" |
21 #include "views/widget/root_view.h" | 21 #include "views/widget/root_view.h" |
22 #include "views/widget/widget.h" | 22 #include "views/widget/widget.h" |
23 | 23 |
24 #if defined(OS_LINUX) | 24 #if defined(OS_LINUX) |
25 #include "app/keyboard_code_conversion_gtk.h" | 25 #include "app/keyboard_code_conversion_gtk.h" |
26 #endif | 26 #endif |
27 | 27 |
28 #if defined(TOUCH_UI) | 28 #if defined(TOUCH_UI) |
29 #include "views/focus/accelerator_handler.h" | 29 #include "views/focus/accelerator_handler.h" |
30 #endif | 30 #endif |
31 | 31 |
32 using base::Time; | 32 using base::Time; |
33 using base::TimeDelta; | 33 using base::TimeDelta; |
| 34 using ui::OSExchangeData; |
34 | 35 |
35 // Period of the scroll timer (in milliseconds). | 36 // Period of the scroll timer (in milliseconds). |
36 static const int kScrollTimerMS = 30; | 37 static const int kScrollTimerMS = 30; |
37 | 38 |
38 // Delay, in ms, between when menus are selected are moused over and the menu | 39 // Delay, in ms, between when menus are selected are moused over and the menu |
39 // appears. | 40 // appears. |
40 static const int kShowDelay = 400; | 41 static const int kShowDelay = 400; |
41 | 42 |
42 // Amount of time from when the drop exits the menu and the menu is hidden. | 43 // Amount of time from when the drop exits the menu and the menu is hidden. |
43 static const int kCloseOnExitTime = 1200; | 44 static const int kCloseOnExitTime = 1200; |
(...skipping 1772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1816 | 1817 |
1817 MouseEvent release_event(Event::ET_MOUSE_RELEASED, -1, -1, 0); | 1818 MouseEvent release_event(Event::ET_MOUSE_RELEASED, -1, -1, 0); |
1818 // Reset the active_mouse_view_ before sending mouse released. That way if if | 1819 // Reset the active_mouse_view_ before sending mouse released. That way if if |
1819 // calls back to use we aren't in a weird state. | 1820 // calls back to use we aren't in a weird state. |
1820 View* active_view = active_mouse_view_; | 1821 View* active_view = active_mouse_view_; |
1821 active_mouse_view_ = NULL; | 1822 active_mouse_view_ = NULL; |
1822 active_view->OnMouseReleased(release_event, true); | 1823 active_view->OnMouseReleased(release_event, true); |
1823 } | 1824 } |
1824 | 1825 |
1825 } // namespace views | 1826 } // namespace views |
OLD | NEW |