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

Side by Side Diff: ui/views/event_monitor.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/corewm/tooltip_controller_unittest.cc ('k') | ui/views/event_monitor_aura.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_EVENT_MONITOR_H_ 5 #ifndef UI_VIEWS_EVENT_MONITOR_H_
6 #define UI_VIEWS_EVENT_MONITOR_H_ 6 #define UI_VIEWS_EVENT_MONITOR_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include <memory>
9
9 #include "ui/gfx/geometry/point.h" 10 #include "ui/gfx/geometry/point.h"
10 #include "ui/gfx/native_widget_types.h" 11 #include "ui/gfx/native_widget_types.h"
11 #include "ui/views/views_export.h" 12 #include "ui/views/views_export.h"
12 13
13 namespace ui { 14 namespace ui {
14 class EventHandler; 15 class EventHandler;
15 } 16 }
16 17
17 namespace views { 18 namespace views {
18 19
19 // RAII-style class that forwards events to |event_handler| before they are 20 // RAII-style class that forwards events to |event_handler| before they are
20 // dispatched. 21 // dispatched.
21 class VIEWS_EXPORT EventMonitor { 22 class VIEWS_EXPORT EventMonitor {
22 public: 23 public:
23 virtual ~EventMonitor() {} 24 virtual ~EventMonitor() {}
24 25
25 // Create an instance for monitoring application events. 26 // Create an instance for monitoring application events.
26 // Events will be forwarded to |event_handler| before they are dispatched to 27 // Events will be forwarded to |event_handler| before they are dispatched to
27 // the application. 28 // the application.
28 static scoped_ptr<EventMonitor> CreateApplicationMonitor( 29 static std::unique_ptr<EventMonitor> CreateApplicationMonitor(
29 ui::EventHandler* event_handler); 30 ui::EventHandler* event_handler);
30 31
31 // Create an instance for monitoring events on a specific window. 32 // Create an instance for monitoring events on a specific window.
32 // Events will be forwarded to |event_handler| before they are dispatched to 33 // Events will be forwarded to |event_handler| before they are dispatched to
33 // |target_window|. 34 // |target_window|.
34 // The EventMonitor instance must be destroyed before |target_window|. 35 // The EventMonitor instance must be destroyed before |target_window|.
35 static scoped_ptr<EventMonitor> CreateWindowMonitor( 36 static std::unique_ptr<EventMonitor> CreateWindowMonitor(
36 ui::EventHandler* event_handler, 37 ui::EventHandler* event_handler,
37 gfx::NativeWindow target_window); 38 gfx::NativeWindow target_window);
38 39
39 // Returns the last mouse location seen in a mouse event in screen 40 // Returns the last mouse location seen in a mouse event in screen
40 // coordinates. 41 // coordinates.
41 static gfx::Point GetLastMouseLocation(); 42 static gfx::Point GetLastMouseLocation();
42 }; 43 };
43 44
44 } // namespace views 45 } // namespace views
45 46
46 #endif // UI_VIEWS_EVENT_MONITOR_H_ 47 #endif // UI_VIEWS_EVENT_MONITOR_H_
OLDNEW
« no previous file with comments | « ui/views/corewm/tooltip_controller_unittest.cc ('k') | ui/views/event_monitor_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698