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

Side by Side Diff: views/controls/menu/menu_controller.cc

Issue 1545011: BookmarkBarView tests fixes (Closed)
Patch Set: remove unnecessary change (correct one this time) Created 10 years, 8 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
« no previous file with comments | « chrome/common/notification_type.h ('k') | no next file » | 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) 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/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/os_exchange_data.h" 8 #include "app/os_exchange_data.h"
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/keyboard_codes.h" 10 #include "base/keyboard_codes.h"
11 #include "base/time.h" 11 #include "base/time.h"
12 #include "gfx/canvas.h" 12 #include "gfx/canvas.h"
13 #include "views/controls/button/menu_button.h" 13 #include "views/controls/button/menu_button.h"
14 #include "views/controls/menu/menu_scroll_view_container.h" 14 #include "views/controls/menu/menu_scroll_view_container.h"
15 #include "views/controls/menu/submenu_view.h" 15 #include "views/controls/menu/submenu_view.h"
16 #include "views/drag_utils.h" 16 #include "views/drag_utils.h"
17 #include "views/screen.h" 17 #include "views/screen.h"
18 #include "views/view_constants.h" 18 #include "views/view_constants.h"
19 #include "views/widget/root_view.h" 19 #include "views/widget/root_view.h"
20 #include "views/widget/widget.h" 20 #include "views/widget/widget.h"
21 #if defined(OS_LINUX)
22 #include "base/keyboard_code_conversion_gtk.h"
23 #endif
21 24
22 using base::Time; 25 using base::Time;
23 using base::TimeDelta; 26 using base::TimeDelta;
24 27
25 // Period of the scroll timer (in milliseconds). 28 // Period of the scroll timer (in milliseconds).
26 static const int kScrollTimerMS = 30; 29 static const int kScrollTimerMS = 30;
27 30
28 // Delay, in ms, between when menus are selected are moused over and the menu 31 // Delay, in ms, between when menus are selected are moused over and the menu
29 // appears. 32 // appears.
30 static const int kShowDelay = 400; 33 static const int kShowDelay = 400;
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 691
689 #else 692 #else
690 bool MenuController::Dispatch(GdkEvent* event) { 693 bool MenuController::Dispatch(GdkEvent* event) {
691 gtk_main_do_event(event); 694 gtk_main_do_event(event);
692 695
693 if (exit_type_ == EXIT_ALL) 696 if (exit_type_ == EXIT_ALL)
694 return false; 697 return false;
695 698
696 switch (event->type) { 699 switch (event->type) {
697 case GDK_KEY_PRESS: { 700 case GDK_KEY_PRESS: {
698 if (!OnKeyDown(event->key.keyval)) 701 base::KeyboardCode win_keycode =
702 base::WindowsKeyCodeForGdkKeyCode(event->key.keyval);
703 if (!OnKeyDown(win_keycode))
699 return false; 704 return false;
700 guint32 keycode = gdk_keyval_to_unicode(event->key.keyval); 705 guint32 keycode = gdk_keyval_to_unicode(event->key.keyval);
701 if (keycode) 706 if (keycode)
702 return !SelectByChar(keycode); 707 return !SelectByChar(keycode);
703 return true; 708 return true;
704 } 709 }
705 710
706 default: 711 default:
707 break; 712 break;
708 } 713 }
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
1496 if (!scroll_task_.get()) 1501 if (!scroll_task_.get())
1497 scroll_task_.reset(new MenuScrollTask()); 1502 scroll_task_.reset(new MenuScrollTask());
1498 scroll_task_->Update(part); 1503 scroll_task_->Update(part);
1499 } 1504 }
1500 1505
1501 void MenuController::StopScrolling() { 1506 void MenuController::StopScrolling() {
1502 scroll_task_.reset(NULL); 1507 scroll_task_.reset(NULL);
1503 } 1508 }
1504 1509
1505 } // namespace views 1510 } // namespace views
OLDNEW
« no previous file with comments | « chrome/common/notification_type.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698