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

Side by Side Diff: ui/aura/scoped_window_targeter.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/scoped_window_targeter.h ('k') | ui/aura/test/aura_test_base.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/scoped_window_targeter.h" 5 #include "ui/aura/scoped_window_targeter.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ui/aura/window.h" 9 #include "ui/aura/window.h"
10 10
11 namespace aura { 11 namespace aura {
12 12
13 ScopedWindowTargeter::ScopedWindowTargeter( 13 ScopedWindowTargeter::ScopedWindowTargeter(
14 Window* window, 14 Window* window,
15 scoped_ptr<ui::EventTargeter> new_targeter) 15 std::unique_ptr<ui::EventTargeter> new_targeter)
16 : window_(window), 16 : window_(window),
17 old_targeter_(window->SetEventTargeter(std::move(new_targeter))) { 17 old_targeter_(window->SetEventTargeter(std::move(new_targeter))) {
18 window_->AddObserver(this); 18 window_->AddObserver(this);
19 } 19 }
20 20
21 ScopedWindowTargeter::~ScopedWindowTargeter() { 21 ScopedWindowTargeter::~ScopedWindowTargeter() {
22 if (window_) { 22 if (window_) {
23 window_->RemoveObserver(this); 23 window_->RemoveObserver(this);
24 window_->SetEventTargeter(std::move(old_targeter_)); 24 window_->SetEventTargeter(std::move(old_targeter_));
25 } 25 }
26 } 26 }
27 27
28 void ScopedWindowTargeter::OnWindowDestroyed(Window* window) { 28 void ScopedWindowTargeter::OnWindowDestroyed(Window* window) {
29 CHECK_EQ(window_, window); 29 CHECK_EQ(window_, window);
30 window_ = NULL; 30 window_ = NULL;
31 old_targeter_.reset(); 31 old_targeter_.reset();
32 } 32 }
33 33
34 } // namespace aura 34 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/scoped_window_targeter.h ('k') | ui/aura/test/aura_test_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698