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

Side by Side Diff: ui/events/event_utils.cc

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/events/event_utils.h ('k') | ui/events/gesture_detection/gesture_detector.h » ('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 #include "ui/events/event_utils.h" 5 #include "ui/events/event_utils.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ui/gfx/display.h" 9 #include "ui/gfx/display.h"
10 #include "ui/gfx/screen.h" 10 #include "ui/gfx/screen.h"
11 11
12 namespace ui { 12 namespace ui {
13 13
14 namespace { 14 namespace {
15 int g_custom_event_types = ET_LAST; 15 int g_custom_event_types = ET_LAST;
16 } // namespace 16 } // namespace
17 17
18 scoped_ptr<Event> EventFromNative(const base::NativeEvent& native_event) { 18 std::unique_ptr<Event> EventFromNative(const base::NativeEvent& native_event) {
19 scoped_ptr<Event> event; 19 std::unique_ptr<Event> event;
20 EventType type = EventTypeFromNative(native_event); 20 EventType type = EventTypeFromNative(native_event);
21 switch(type) { 21 switch(type) {
22 case ET_KEY_PRESSED: 22 case ET_KEY_PRESSED:
23 case ET_KEY_RELEASED: 23 case ET_KEY_RELEASED:
24 event.reset(new KeyEvent(native_event)); 24 event.reset(new KeyEvent(native_event));
25 break; 25 break;
26 26
27 case ET_MOUSE_PRESSED: 27 case ET_MOUSE_PRESSED:
28 case ET_MOUSE_DRAGGED: 28 case ET_MOUSE_DRAGGED:
29 case ET_MOUSE_RELEASED: 29 case ET_MOUSE_RELEASED:
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 const std::vector<gfx::Display>& displays = screen->GetAllDisplays(); 78 const std::vector<gfx::Display>& displays = screen->GetAllDisplays();
79 for (std::vector<gfx::Display>::const_iterator it = displays.begin(); 79 for (std::vector<gfx::Display>::const_iterator it = displays.begin();
80 it != displays.end(); ++it) { 80 it != displays.end(); ++it) {
81 if (it->IsInternal()) 81 if (it->IsInternal())
82 return it->touch_support(); 82 return it->touch_support();
83 } 83 }
84 return gfx::Display::TOUCH_SUPPORT_UNAVAILABLE; 84 return gfx::Display::TOUCH_SUPPORT_UNAVAILABLE;
85 } 85 }
86 86
87 } // namespace ui 87 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/event_utils.h ('k') | ui/events/gesture_detection/gesture_detector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698