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

Side by Side Diff: mash/wm/frame/move_event_handler.cc

Issue 1857623003: convert //mash to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « mash/wm/frame/move_event_handler.h ('k') | mash/wm/frame/move_loop.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "mash/wm/frame/move_event_handler.h" 5 #include "mash/wm/frame/move_event_handler.h"
6 6
7 #include "components/mus/public/cpp/window.h" 7 #include "components/mus/public/cpp/window.h"
8 #include "components/mus/public/interfaces/cursor.mojom.h" 8 #include "components/mus/public/interfaces/cursor.mojom.h"
9 #include "mash/wm/frame/move_loop.h" 9 #include "mash/wm/frame/move_loop.h"
10 #include "mojo/converters/input_events/input_events_type_converters.h" 10 #include "mojo/converters/input_events/input_events_type_converters.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 DCHECK(event->IsMouseEvent() || event->IsTouchEvent()); 59 DCHECK(event->IsMouseEvent() || event->IsTouchEvent());
60 60
61 // This event handler can receive mouse events like ET_MOUSE_CAPTURE_CHANGED 61 // This event handler can receive mouse events like ET_MOUSE_CAPTURE_CHANGED
62 // that cannot be converted to PointerEvents. Ignore them because they aren't 62 // that cannot be converted to PointerEvents. Ignore them because they aren't
63 // needed for move handling. 63 // needed for move handling.
64 if (!ui::PointerEvent::CanConvertFrom(*event)) 64 if (!ui::PointerEvent::CanConvertFrom(*event))
65 return; 65 return;
66 66
67 // TODO(moshayedi): no need for this once MoveEventHandler directly receives 67 // TODO(moshayedi): no need for this once MoveEventHandler directly receives
68 // pointer events. 68 // pointer events.
69 scoped_ptr<ui::PointerEvent> pointer_event; 69 std::unique_ptr<ui::PointerEvent> pointer_event;
70 if (event->IsMouseEvent()) 70 if (event->IsMouseEvent())
71 pointer_event.reset(new ui::PointerEvent(*event->AsMouseEvent())); 71 pointer_event.reset(new ui::PointerEvent(*event->AsMouseEvent()));
72 else 72 else
73 pointer_event.reset(new ui::PointerEvent(*event->AsTouchEvent())); 73 pointer_event.reset(new ui::PointerEvent(*event->AsTouchEvent()));
74 74
75 if (move_loop_) { 75 if (move_loop_) {
76 if (move_loop_->Move(*pointer_event.get()) == MoveLoop::DONE) 76 if (move_loop_->Move(*pointer_event.get()) == MoveLoop::DONE)
77 move_loop_.reset(); 77 move_loop_.reset();
78 } else if (pointer_event->type() == ui::ET_POINTER_DOWN) { 78 } else if (pointer_event->type() == ui::ET_POINTER_DOWN) {
79 const int ht_location = GetNonClientComponentForEvent(pointer_event.get()); 79 const int ht_location = GetNonClientComponentForEvent(pointer_event.get());
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 event->SetHandled(); 120 event->SetHandled();
121 } 121 }
122 122
123 void MoveEventHandler::OnWindowDestroying(aura::Window* window) { 123 void MoveEventHandler::OnWindowDestroying(aura::Window* window) {
124 DCHECK_EQ(root_window_, window); 124 DCHECK_EQ(root_window_, window);
125 Detach(); 125 Detach();
126 } 126 }
127 127
128 } // namespace wm 128 } // namespace wm
129 } // namespace mash 129 } // namespace mash
OLDNEW
« no previous file with comments | « mash/wm/frame/move_event_handler.h ('k') | mash/wm/frame/move_loop.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698