OLD | NEW |
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 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 5 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
6 #define UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 6 #define UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #include <list> | 10 #include <list> |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 // the selection is changed such that the menu opens immediately. | 409 // the selection is changed such that the menu opens immediately. |
410 void OpenSubmenuChangeSelectionIfCan(); | 410 void OpenSubmenuChangeSelectionIfCan(); |
411 | 411 |
412 // If possible, closes the submenu. | 412 // If possible, closes the submenu. |
413 void CloseSubmenu(); | 413 void CloseSubmenu(); |
414 | 414 |
415 // Returns details about which menu items match the mnemonic |key|. | 415 // Returns details about which menu items match the mnemonic |key|. |
416 // |match_function| is used to determine which menus match. | 416 // |match_function| is used to determine which menus match. |
417 SelectByCharDetails FindChildForMnemonic( | 417 SelectByCharDetails FindChildForMnemonic( |
418 MenuItemView* parent, | 418 MenuItemView* parent, |
419 char16 key, | 419 base::char16 key, |
420 bool (*match_function)(MenuItemView* menu, char16 mnemonic)); | 420 bool (*match_function)(MenuItemView* menu, base::char16 mnemonic)); |
421 | 421 |
422 // Selects or accepts the appropriate menu item based on |details|. Returns | 422 // Selects or accepts the appropriate menu item based on |details|. Returns |
423 // true if |Accept| was invoked (which happens if there aren't multiple item | 423 // true if |Accept| was invoked (which happens if there aren't multiple item |
424 // with the same mnemonic and the item to select does not have a submenu). | 424 // with the same mnemonic and the item to select does not have a submenu). |
425 bool AcceptOrSelect(MenuItemView* parent, const SelectByCharDetails& details); | 425 bool AcceptOrSelect(MenuItemView* parent, const SelectByCharDetails& details); |
426 | 426 |
427 // Selects by mnemonic, and if that doesn't work tries the first character of | 427 // Selects by mnemonic, and if that doesn't work tries the first character of |
428 // the title. Returns true if a match was selected and the menu should exit. | 428 // the title. Returns true if a match was selected and the menu should exit. |
429 bool SelectByChar(char16 key); | 429 bool SelectByChar(base::char16 key); |
430 | 430 |
431 // For Windows and Aura we repost an event for some events that dismiss | 431 // For Windows and Aura we repost an event for some events that dismiss |
432 // the context menu. The event is then reprocessed to cause its result | 432 // the context menu. The event is then reprocessed to cause its result |
433 // if the context menu had not been present. | 433 // if the context menu had not been present. |
434 // On non-aura Windows, a new mouse event is generated and posted to | 434 // On non-aura Windows, a new mouse event is generated and posted to |
435 // the window (if there is one) at the location of the event. On | 435 // the window (if there is one) at the location of the event. On |
436 // aura, the event is reposted on the RootWindow. | 436 // aura, the event is reposted on the RootWindow. |
437 void RepostEvent(SubmenuView* source, const ui::LocatedEvent& event); | 437 void RepostEvent(SubmenuView* source, const ui::LocatedEvent& event); |
438 | 438 |
439 // Sets the drop target to new_item. | 439 // Sets the drop target to new_item. |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 | 589 |
590 // Set to true if the menu item was selected by touch. | 590 // Set to true if the menu item was selected by touch. |
591 bool item_selected_by_touch_; | 591 bool item_selected_by_touch_; |
592 | 592 |
593 DISALLOW_COPY_AND_ASSIGN(MenuController); | 593 DISALLOW_COPY_AND_ASSIGN(MenuController); |
594 }; | 594 }; |
595 | 595 |
596 } // namespace views | 596 } // namespace views |
597 | 597 |
598 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 598 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
OLD | NEW |