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

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

Issue 10446010: wip: Add ui::EventType parameter. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: wip - views_unittests Created 8 years, 7 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 | « ui/views/controls/button/text_button.cc ('k') | ui/views/controls/tabbed_pane/tabbed_pane.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/views/controls/menu/menu_controller.h" 5 #include "ui/views/controls/menu/menu_controller.h"
6 6
7 #include "base/i18n/case_conversion.h" 7 #include "base/i18n/case_conversion.h"
8 #include "base/i18n/rtl.h" 8 #include "base/i18n/rtl.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after
1054 StopShowTimer(); 1054 StopShowTimer();
1055 StopCancelAllTimer(); 1055 StopCancelAllTimer();
1056 } 1056 }
1057 1057
1058 MenuController::SendAcceleratorResultType 1058 MenuController::SendAcceleratorResultType
1059 MenuController::SendAcceleratorToHotTrackedView() { 1059 MenuController::SendAcceleratorToHotTrackedView() {
1060 View* hot_view = GetFirstHotTrackedView(pending_state_.item); 1060 View* hot_view = GetFirstHotTrackedView(pending_state_.item);
1061 if (!hot_view) 1061 if (!hot_view)
1062 return ACCELERATOR_NOT_PROCESSED; 1062 return ACCELERATOR_NOT_PROCESSED;
1063 1063
1064 ui::Accelerator accelerator(ui::VKEY_RETURN, ui::EF_NONE); 1064 ui::Accelerator accelerator(ui::VKEY_RETURN, ui::EF_NONE, ui::ET_KEY_PRESSED);
1065 hot_view->AcceleratorPressed(accelerator); 1065 hot_view->AcceleratorPressed(accelerator);
1066 if (hot_view->GetClassName() == CustomButton::kViewClassName) { 1066 if (hot_view->GetClassName() == CustomButton::kViewClassName) {
1067 CustomButton* button = static_cast<CustomButton*>(hot_view); 1067 CustomButton* button = static_cast<CustomButton*>(hot_view);
1068 button->SetHotTracked(true); 1068 button->SetHotTracked(true);
1069 } 1069 }
1070 return (exit_type_ == EXIT_NONE) ? 1070 return (exit_type_ == EXIT_NONE) ?
1071 ACCELERATOR_PROCESSED : ACCELERATOR_PROCESSED_EXIT; 1071 ACCELERATOR_PROCESSED : ACCELERATOR_PROCESSED_EXIT;
1072 } 1072 }
1073 1073
1074 void MenuController::UpdateInitialLocation( 1074 void MenuController::UpdateInitialLocation(
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after
2048 (!pending_state_.item->HasSubmenu() || 2048 (!pending_state_.item->HasSubmenu() ||
2049 !pending_state_.item->GetSubmenu()->IsShowing())) { 2049 !pending_state_.item->GetSubmenu()->IsShowing())) {
2050 // On exit if the user hasn't selected an item with a submenu, move the 2050 // On exit if the user hasn't selected an item with a submenu, move the
2051 // selection back to the parent menu item. 2051 // selection back to the parent menu item.
2052 SetSelection(pending_state_.item->GetParentMenuItem(), 2052 SetSelection(pending_state_.item->GetParentMenuItem(),
2053 SELECTION_OPEN_SUBMENU); 2053 SELECTION_OPEN_SUBMENU);
2054 } 2054 }
2055 } 2055 }
2056 2056
2057 } // namespace views 2057 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/text_button.cc ('k') | ui/views/controls/tabbed_pane/tabbed_pane.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698