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

Side by Side Diff: ash/wm/window_state.cc

Issue 1609923002: Fix remaining incompatibilities between scoped_ptr and unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ash/wm/window_state.h" 5 #include "ash/wm/window_state.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/ash_switches.h" 9 #include "ash/ash_switches.h"
10 #include "ash/root_window_controller.h" 10 #include "ash/root_window_controller.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 } // namespace 85 } // namespace
86 86
87 WindowState::~WindowState() { 87 WindowState::~WindowState() {
88 // WindowState is registered as an owned property of |window_|, and window 88 // WindowState is registered as an owned property of |window_|, and window
89 // unregisters all of its observers in its d'tor before destroying its 89 // unregisters all of its observers in its d'tor before destroying its
90 // properties. As a result, window_->RemoveObserver() doesn't need to (and 90 // properties. As a result, window_->RemoveObserver() doesn't need to (and
91 // shouldn't) be called here. 91 // shouldn't) be called here.
92 } 92 }
93 93
94 bool WindowState::HasDelegate() const { 94 bool WindowState::HasDelegate() const {
95 return delegate_; 95 return !!delegate_;
96 } 96 }
97 97
98 void WindowState::SetDelegate(scoped_ptr<WindowStateDelegate> delegate) { 98 void WindowState::SetDelegate(scoped_ptr<WindowStateDelegate> delegate) {
99 DCHECK(!delegate_.get()); 99 DCHECK(!delegate_.get());
100 delegate_ = std::move(delegate); 100 delegate_ = std::move(delegate);
101 } 101 }
102 102
103 WindowStateType WindowState::GetStateType() const { 103 WindowStateType WindowState::GetStateType() const {
104 return current_state_->GetType(); 104 return current_state_->GetType();
105 } 105 }
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 } 497 }
498 return settings; 498 return settings;
499 } 499 }
500 500
501 const WindowState* GetWindowState(const aura::Window* window) { 501 const WindowState* GetWindowState(const aura::Window* window) {
502 return GetWindowState(const_cast<aura::Window*>(window)); 502 return GetWindowState(const_cast<aura::Window*>(window));
503 } 503 }
504 504
505 } // namespace wm 505 } // namespace wm
506 } // namespace ash 506 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698