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

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

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr Created 4 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 | « ui/views/controls/label_unittest.cc ('k') | ui/views/controls/menu/menu_controller.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 #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"
9
10 #include <stddef.h> 8 #include <stddef.h>
11 9
12 #include <list> 10 #include <list>
11 #include <memory>
13 #include <set> 12 #include <set>
14 #include <vector> 13 #include <vector>
15 14
16 #include "base/compiler_specific.h" 15 #include "base/compiler_specific.h"
17 #include "base/macros.h" 16 #include "base/macros.h"
18 #include "base/memory/linked_ptr.h" 17 #include "base/memory/linked_ptr.h"
19 #include "base/memory/scoped_ptr.h"
20 #include "base/timer/timer.h" 18 #include "base/timer/timer.h"
19 #include "build/build_config.h"
21 #include "ui/events/event.h" 20 #include "ui/events/event.h"
22 #include "ui/events/event_constants.h" 21 #include "ui/events/event_constants.h"
23 #include "ui/events/platform/platform_event_dispatcher.h" 22 #include "ui/events/platform/platform_event_dispatcher.h"
24 #include "ui/views/controls/button/menu_button.h" 23 #include "ui/views/controls/button/menu_button.h"
25 #include "ui/views/controls/menu/menu_config.h" 24 #include "ui/views/controls/menu/menu_config.h"
26 #include "ui/views/controls/menu/menu_delegate.h" 25 #include "ui/views/controls/menu/menu_delegate.h"
27 #include "ui/views/widget/widget_observer.h" 26 #include "ui/views/widget/widget_observer.h"
28 27
29 namespace gfx { 28 namespace gfx {
30 class Screen; 29 class Screen;
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 // continually processing whether we can drop, we cache the coordinates. 646 // continually processing whether we can drop, we cache the coordinates.
648 bool valid_drop_coordinates_; 647 bool valid_drop_coordinates_;
649 gfx::Point drop_pt_; 648 gfx::Point drop_pt_;
650 int last_drop_operation_; 649 int last_drop_operation_;
651 650
652 // If true, we're in the middle of invoking ShowAt on a submenu. 651 // If true, we're in the middle of invoking ShowAt on a submenu.
653 bool showing_submenu_; 652 bool showing_submenu_;
654 653
655 // Task for scrolling the menu. If non-null indicates a scroll is currently 654 // Task for scrolling the menu. If non-null indicates a scroll is currently
656 // underway. 655 // underway.
657 scoped_ptr<MenuScrollTask> scroll_task_; 656 std::unique_ptr<MenuScrollTask> scroll_task_;
658 657
659 // The lock to keep the menu button pressed while a menu is visible. 658 // The lock to keep the menu button pressed while a menu is visible.
660 scoped_ptr<MenuButton::PressedLock> pressed_lock_; 659 std::unique_ptr<MenuButton::PressedLock> pressed_lock_;
661 660
662 // ViewStorage id used to store the view mouse drag events are forwarded to. 661 // ViewStorage id used to store the view mouse drag events are forwarded to.
663 // See UpdateActiveMouseView() for details. 662 // See UpdateActiveMouseView() for details.
664 const int active_mouse_view_id_; 663 const int active_mouse_view_id_;
665 664
666 // Current hot tracked child button if any. 665 // Current hot tracked child button if any.
667 CustomButton* hot_button_; 666 CustomButton* hot_button_;
668 667
669 internal::MenuControllerDelegate* delegate_; 668 internal::MenuControllerDelegate* delegate_;
670 669
(...skipping 24 matching lines...) Expand all
695 694
696 // During mouse event handling, this is the RootView to forward mouse events 695 // During mouse event handling, this is the RootView to forward mouse events
697 // to. We need this, because if we forward one event to it (e.g., mouse 696 // to. We need this, because if we forward one event to it (e.g., mouse
698 // pressed), subsequent events (like dragging) should also go to it, even if 697 // pressed), subsequent events (like dragging) should also go to it, even if
699 // the mouse is no longer over the view. 698 // the mouse is no longer over the view.
700 MenuHostRootView* current_mouse_event_target_; 699 MenuHostRootView* current_mouse_event_target_;
701 700
702 // A mask of the EventFlags for the mouse buttons currently pressed. 701 // A mask of the EventFlags for the mouse buttons currently pressed.
703 int current_mouse_pressed_state_; 702 int current_mouse_pressed_state_;
704 703
705 scoped_ptr<MenuMessageLoop> message_loop_; 704 std::unique_ptr<MenuMessageLoop> message_loop_;
706 705
707 #if defined(USE_AURA) 706 #if defined(USE_AURA)
708 scoped_ptr<MenuKeyEventHandler> key_event_handler_; 707 std::unique_ptr<MenuKeyEventHandler> key_event_handler_;
709 #endif 708 #endif
710 709
711 DISALLOW_COPY_AND_ASSIGN(MenuController); 710 DISALLOW_COPY_AND_ASSIGN(MenuController);
712 }; 711 };
713 712
714 } // namespace views 713 } // namespace views
715 714
716 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_ 715 #endif // UI_VIEWS_CONTROLS_MENU_MENU_CONTROLLER_H_
OLDNEW
« no previous file with comments | « ui/views/controls/label_unittest.cc ('k') | ui/views/controls/menu/menu_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698