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 <stddef.h> | 10 #include <stddef.h> |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 bool (*match_function)(MenuItemView* menu, base::char16 mnemonic)); | 491 bool (*match_function)(MenuItemView* menu, base::char16 mnemonic)); |
492 | 492 |
493 // Selects or accepts the appropriate menu item based on |details|. | 493 // Selects or accepts the appropriate menu item based on |details|. |
494 void AcceptOrSelect(MenuItemView* parent, const SelectByCharDetails& details); | 494 void AcceptOrSelect(MenuItemView* parent, const SelectByCharDetails& details); |
495 | 495 |
496 // Selects by mnemonic, and if that doesn't work tries the first character of | 496 // Selects by mnemonic, and if that doesn't work tries the first character of |
497 // the title. | 497 // the title. |
498 void SelectByChar(base::char16 key); | 498 void SelectByChar(base::char16 key); |
499 | 499 |
500 // For Windows and Aura we repost an event which dismisses the |source| menu. | 500 // For Windows and Aura we repost an event which dismisses the |source| menu. |
501 // The menu is also canceled dependent on the target of the event. The event | 501 // The menu may also be canceled depending on the target of the event. |event| |
502 // is then reprocessed to cause its result if the menu had not been present. | 502 // is then processed without the menu present. On non-aura Windows, a new |
503 // On non-aura Windows, a new mouse event is generated and posted to | 503 // mouse event is generated and posted to the window (if there is one) at the |
504 // the window (if there is one) at the location of the event. On | 504 // location of the event. On aura, the event is reposted on the RootWindow. |
505 // aura, the event is reposted on the RootWindow. | |
506 void RepostEventAndCancel(SubmenuView* source, const ui::LocatedEvent* event); | 505 void RepostEventAndCancel(SubmenuView* source, const ui::LocatedEvent* event); |
507 | 506 |
508 // Sets the drop target to new_item. | 507 // Sets the drop target to new_item. |
509 void SetDropMenuItem(MenuItemView* new_item, | 508 void SetDropMenuItem(MenuItemView* new_item, |
510 MenuDelegate::DropPosition position); | 509 MenuDelegate::DropPosition position); |
511 | 510 |
512 // Starts/stops scrolling as appropriate. part gives the part the mouse is | 511 // Starts/stops scrolling as appropriate. part gives the part the mouse is |
513 // over. | 512 // over. |
514 void UpdateScrolling(const MenuPart& part); | 513 void UpdateScrolling(const MenuPart& part); |
515 | 514 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 void ExitAsyncRun(); | 549 void ExitAsyncRun(); |
551 | 550 |
552 // Performs the teardown of the menu launched by Run(). The selected item is | 551 // Performs the teardown of the menu launched by Run(). The selected item is |
553 // returned. | 552 // returned. |
554 MenuItemView* ExitMenuRun(); | 553 MenuItemView* ExitMenuRun(); |
555 | 554 |
556 // Handles the mouse location event on the submenu |source|. | 555 // Handles the mouse location event on the submenu |source|. |
557 void HandleMouseLocation(SubmenuView* source, | 556 void HandleMouseLocation(SubmenuView* source, |
558 const gfx::Point& mouse_location); | 557 const gfx::Point& mouse_location); |
559 | 558 |
| 559 // Sets hot-tracked state to the first focusable descendant view of |item|. |
| 560 void SetInitialHotTrackedView(MenuItemView* item, |
| 561 SelectionIncrementDirectionType direction); |
| 562 |
560 // The active instance. | 563 // The active instance. |
561 static MenuController* active_instance_; | 564 static MenuController* active_instance_; |
562 | 565 |
563 // If true, Run blocks. If false, Run doesn't block and this is used for | 566 // If true, Run blocks. If false, Run doesn't block and this is used for |
564 // drag and drop. Note that the semantics for drag and drop are slightly | 567 // drag and drop. Note that the semantics for drag and drop are slightly |
565 // different: cancel timer is kicked off any time the drag moves outside the | 568 // different: cancel timer is kicked off any time the drag moves outside the |
566 // menu, mouse events do nothing... | 569 // menu, mouse events do nothing... |
567 bool blocking_run_; | 570 bool blocking_run_; |
568 | 571 |
569 // If true, we're showing. | 572 // If true, we're showing. |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 #if defined(USE_AURA) | 699 #if defined(USE_AURA) |
697 scoped_ptr<MenuKeyEventHandler> key_event_handler_; | 700 scoped_ptr<MenuKeyEventHandler> key_event_handler_; |
698 #endif | 701 #endif |
699 | 702 |
700 DISALLOW_COPY_AND_ASSIGN(MenuController); | 703 DISALLOW_COPY_AND_ASSIGN(MenuController); |
701 }; | 704 }; |
702 | 705 |
703 } // namespace views | 706 } // namespace views |
704 | 707 |
705 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 708 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
OLD | NEW |