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

Side by Side Diff: ui/aura/scoped_window_targeter.cc

Issue 1539583003: Convert Pass()→std::move() in ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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/env.cc ('k') | ui/aura/test/aura_test_utils.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 #include "ui/aura/scoped_window_targeter.h" 5 #include "ui/aura/scoped_window_targeter.h"
6 6
7 #include <utility>
8
7 #include "ui/aura/window.h" 9 #include "ui/aura/window.h"
8 10
9 namespace aura { 11 namespace aura {
10 12
11 ScopedWindowTargeter::ScopedWindowTargeter( 13 ScopedWindowTargeter::ScopedWindowTargeter(
12 Window* window, 14 Window* window,
13 scoped_ptr<ui::EventTargeter> new_targeter) 15 scoped_ptr<ui::EventTargeter> new_targeter)
14 : window_(window), 16 : window_(window),
15 old_targeter_(window->SetEventTargeter(new_targeter.Pass())) { 17 old_targeter_(window->SetEventTargeter(std::move(new_targeter))) {
16 window_->AddObserver(this); 18 window_->AddObserver(this);
17 } 19 }
18 20
19 ScopedWindowTargeter::~ScopedWindowTargeter() { 21 ScopedWindowTargeter::~ScopedWindowTargeter() {
20 if (window_) { 22 if (window_) {
21 window_->RemoveObserver(this); 23 window_->RemoveObserver(this);
22 window_->SetEventTargeter(old_targeter_.Pass()); 24 window_->SetEventTargeter(std::move(old_targeter_));
23 } 25 }
24 } 26 }
25 27
26 void ScopedWindowTargeter::OnWindowDestroyed(Window* window) { 28 void ScopedWindowTargeter::OnWindowDestroyed(Window* window) {
27 CHECK_EQ(window_, window); 29 CHECK_EQ(window_, window);
28 window_ = NULL; 30 window_ = NULL;
29 old_targeter_.reset(); 31 old_targeter_.reset();
30 } 32 }
31 33
32 } // namespace aura 34 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/env.cc ('k') | ui/aura/test/aura_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698