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

Side by Side Diff: ui/aura/test/aura_test_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/aura/test/aura_test_utils.h ('k') | ui/aura/test/env_test_helper.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 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 #include "ui/aura/test/aura_test_utils.h" 5 #include "ui/aura/test/aura_test_utils.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "ui/aura/window_event_dispatcher.h" 10 #include "ui/aura/window_event_dispatcher.h"
11 #include "ui/aura/window_tree_host.h" 11 #include "ui/aura/window_tree_host.h"
12 12
13 namespace aura { 13 namespace aura {
14 namespace test { 14 namespace test {
15 15
16 class WindowTreeHostTestApi { 16 class WindowTreeHostTestApi {
17 public: 17 public:
18 explicit WindowTreeHostTestApi(WindowTreeHost* host) : host_(host) {} 18 explicit WindowTreeHostTestApi(WindowTreeHost* host) : host_(host) {}
19 19
20 const gfx::Point& last_cursor_request_position_in_host() { 20 const gfx::Point& last_cursor_request_position_in_host() {
21 return host_->last_cursor_request_position_in_host_; 21 return host_->last_cursor_request_position_in_host_;
22 } 22 }
23 23
24 void set_dispatcher(scoped_ptr<WindowEventDispatcher> dispatcher) { 24 void set_dispatcher(std::unique_ptr<WindowEventDispatcher> dispatcher) {
25 host_->dispatcher_ = std::move(dispatcher); 25 host_->dispatcher_ = std::move(dispatcher);
26 } 26 }
27 27
28 private: 28 private:
29 WindowTreeHost* host_; 29 WindowTreeHost* host_;
30 30
31 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostTestApi); 31 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostTestApi);
32 }; 32 };
33 33
34 const gfx::Point& QueryLatestMousePositionRequestInHost(WindowTreeHost* host) { 34 const gfx::Point& QueryLatestMousePositionRequestInHost(WindowTreeHost* host) {
35 WindowTreeHostTestApi host_test_api(host); 35 WindowTreeHostTestApi host_test_api(host);
36 return host_test_api.last_cursor_request_position_in_host(); 36 return host_test_api.last_cursor_request_position_in_host();
37 } 37 }
38 38
39 void SetHostDispatcher(WindowTreeHost* host, 39 void SetHostDispatcher(WindowTreeHost* host,
40 scoped_ptr<WindowEventDispatcher> dispatcher) { 40 std::unique_ptr<WindowEventDispatcher> dispatcher) {
41 WindowTreeHostTestApi host_test_api(host); 41 WindowTreeHostTestApi host_test_api(host);
42 host_test_api.set_dispatcher(std::move(dispatcher)); 42 host_test_api.set_dispatcher(std::move(dispatcher));
43 } 43 }
44 44
45 } // namespace test 45 } // namespace test
46 } // namespace aura 46 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/test/aura_test_utils.h ('k') | ui/aura/test/env_test_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698