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 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 int accept_event_flags_; | 560 int accept_event_flags_; |
561 | 561 |
562 // If not empty, it means we're nested. When Run is invoked from within | 562 // If not empty, it means we're nested. When Run is invoked from within |
563 // Run, the current state (state_) is pushed onto menu_stack_. This allows | 563 // Run, the current state (state_) is pushed onto menu_stack_. This allows |
564 // MenuController to restore the state when the nested run returns. | 564 // MenuController to restore the state when the nested run returns. |
565 typedef std::pair<State, linked_ptr<MenuButton::PressedLock> > NestedState; | 565 typedef std::pair<State, linked_ptr<MenuButton::PressedLock> > NestedState; |
566 std::list<NestedState> menu_stack_; | 566 std::list<NestedState> menu_stack_; |
567 | 567 |
568 // As the mouse moves around submenus are not opened immediately. Instead | 568 // As the mouse moves around submenus are not opened immediately. Instead |
569 // they open after this timer fires. | 569 // they open after this timer fires. |
570 base::OneShotTimer<MenuController> show_timer_; | 570 base::OneShotTimer show_timer_; |
571 | 571 |
572 // Used to invoke CancelAll(). This is used during drag and drop to hide the | 572 // Used to invoke CancelAll(). This is used during drag and drop to hide the |
573 // menu after the mouse moves out of the of the menu. This is necessitated by | 573 // menu after the mouse moves out of the of the menu. This is necessitated by |
574 // the lack of an ability to detect when the drag has completed from the drop | 574 // the lack of an ability to detect when the drag has completed from the drop |
575 // side. | 575 // side. |
576 base::OneShotTimer<MenuController> cancel_all_timer_; | 576 base::OneShotTimer cancel_all_timer_; |
577 | 577 |
578 // Drop target. | 578 // Drop target. |
579 MenuItemView* drop_target_; | 579 MenuItemView* drop_target_; |
580 MenuDelegate::DropPosition drop_position_; | 580 MenuDelegate::DropPosition drop_position_; |
581 | 581 |
582 // Owner of child windows. | 582 // Owner of child windows. |
583 // WARNING: this may be NULL. | 583 // WARNING: this may be NULL. |
584 Widget* owner_; | 584 Widget* owner_; |
585 | 585 |
586 // Indicates a possible drag operation. | 586 // Indicates a possible drag operation. |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 bool item_selected_by_touch_; | 643 bool item_selected_by_touch_; |
644 | 644 |
645 scoped_ptr<MenuMessageLoop> message_loop_; | 645 scoped_ptr<MenuMessageLoop> message_loop_; |
646 | 646 |
647 DISALLOW_COPY_AND_ASSIGN(MenuController); | 647 DISALLOW_COPY_AND_ASSIGN(MenuController); |
648 }; | 648 }; |
649 | 649 |
650 } // namespace views | 650 } // namespace views |
651 | 651 |
652 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ | 652 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ |
OLD | NEW |