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

Side by Side Diff: athena/wm/window_manager_impl.cc

Issue 653563004: NULL -> nullptr under athena/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 6 years, 2 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 | « athena/wm/window_list_provider_impl_unittest.cc ('k') | athena/wm/window_manager_unittest.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 "athena/wm/window_manager_impl.h" 5 #include "athena/wm/window_manager_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "athena/screen/public/screen_manager.h" 9 #include "athena/screen/public/screen_manager.h"
10 #include "athena/util/container_priorities.h" 10 #include "athena/util/container_priorities.h"
(...skipping 13 matching lines...) Expand all
24 #include "ui/gfx/screen.h" 24 #include "ui/gfx/screen.h"
25 #include "ui/wm/core/shadow_controller.h" 25 #include "ui/wm/core/shadow_controller.h"
26 #include "ui/wm/core/transient_window_manager.h" 26 #include "ui/wm/core/transient_window_manager.h"
27 #include "ui/wm/core/window_util.h" 27 #include "ui/wm/core/window_util.h"
28 #include "ui/wm/core/wm_state.h" 28 #include "ui/wm/core/wm_state.h"
29 #include "ui/wm/public/activation_client.h" 29 #include "ui/wm/public/activation_client.h"
30 #include "ui/wm/public/window_types.h" 30 #include "ui/wm/public/window_types.h"
31 31
32 namespace athena { 32 namespace athena {
33 namespace { 33 namespace {
34 class WindowManagerImpl* instance = NULL; 34 class WindowManagerImpl* instance = nullptr;
35 35
36 void SetWindowState(aura::Window* window, 36 void SetWindowState(aura::Window* window,
37 const gfx::Rect& bounds, 37 const gfx::Rect& bounds,
38 const gfx::Transform& transform) { 38 const gfx::Transform& transform) {
39 window->SetBounds(bounds); 39 window->SetBounds(bounds);
40 window->SetTransform(transform); 40 window->SetTransform(transform);
41 } 41 }
42 42
43 } // namespace 43 } // namespace
44 44
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 RemoveObserver(split_view_controller_.get()); 178 RemoveObserver(split_view_controller_.get());
179 split_view_controller_.reset(); 179 split_view_controller_.reset();
180 window_list_provider_.reset(); 180 window_list_provider_.reset();
181 if (container_) { 181 if (container_) {
182 container_->RemoveObserver(this); 182 container_->RemoveObserver(this);
183 container_->RemovePreTargetHandler(bezel_controller_.get()); 183 container_->RemovePreTargetHandler(bezel_controller_.get());
184 } 184 }
185 // |title_drag_controller_| needs to be reset before |container_|. 185 // |title_drag_controller_| needs to be reset before |container_|.
186 title_drag_controller_.reset(); 186 title_drag_controller_.reset();
187 container_.reset(); 187 container_.reset();
188 instance = NULL; 188 instance = nullptr;
189 } 189 }
190 190
191 void WindowManagerImpl::ToggleSplitView() { 191 void WindowManagerImpl::ToggleSplitView() {
192 if (IsOverviewModeActive()) 192 if (IsOverviewModeActive())
193 return; 193 return;
194 194
195 if (split_view_controller_->IsSplitViewModeActive()) { 195 if (split_view_controller_->IsSplitViewModeActive()) {
196 split_view_controller_->DeactivateSplitMode(); 196 split_view_controller_->DeactivateSplitMode();
197 FOR_EACH_OBSERVER(WindowManagerObserver, observers_, OnSplitViewModeExit()); 197 FOR_EACH_OBSERVER(WindowManagerObserver, observers_, OnSplitViewModeExit());
198 // Relayout so that windows are maximzied. 198 // Relayout so that windows are maximzied.
199 container_->layout_manager()->OnWindowResized(); 199 container_->layout_manager()->OnWindowResized();
200 } else if (split_view_controller_->CanActivateSplitViewMode()) { 200 } else if (split_view_controller_->CanActivateSplitViewMode()) {
201 FOR_EACH_OBSERVER(WindowManagerObserver, 201 FOR_EACH_OBSERVER(WindowManagerObserver,
202 observers_, 202 observers_,
203 OnSplitViewModeEnter()); 203 OnSplitViewModeEnter());
204 split_view_controller_->ActivateSplitMode(NULL, NULL, NULL); 204 split_view_controller_->ActivateSplitMode(nullptr, nullptr, nullptr);
205 } 205 }
206 } 206 }
207 207
208 void WindowManagerImpl::EnterOverview() { 208 void WindowManagerImpl::EnterOverview() {
209 if (IsOverviewModeActive()) 209 if (IsOverviewModeActive())
210 return; 210 return;
211 211
212 bezel_controller_->set_left_right_delegate(NULL); 212 bezel_controller_->set_left_right_delegate(nullptr);
213 FOR_EACH_OBSERVER(WindowManagerObserver, observers_, OnOverviewModeEnter()); 213 FOR_EACH_OBSERVER(WindowManagerObserver, observers_, OnOverviewModeEnter());
214 214
215 // Note: The window_list_provider_ resembles the exact window list of the 215 // Note: The window_list_provider_ resembles the exact window list of the
216 // container, so no re-stacking is required before showing the OverviewMode. 216 // container, so no re-stacking is required before showing the OverviewMode.
217 overview_ = WindowOverviewMode::Create( 217 overview_ = WindowOverviewMode::Create(
218 container_.get(), window_list_provider_.get(), 218 container_.get(), window_list_provider_.get(),
219 split_view_controller_.get(), this); 219 split_view_controller_.get(), this);
220 AcceleratorManager::Get()->RegisterAccelerator(kEscAcceleratorData, this); 220 AcceleratorManager::Get()->RegisterAccelerator(kEscAcceleratorData, this);
221 } 221 }
222 222
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 } 363 }
364 return true; 364 return true;
365 } 365 }
366 366
367 aura::Window* WindowManagerImpl::GetWindowBehind(aura::Window* window) { 367 aura::Window* WindowManagerImpl::GetWindowBehind(aura::Window* window) {
368 const aura::Window::Windows& windows = window_list_provider_->GetWindowList(); 368 const aura::Window::Windows& windows = window_list_provider_->GetWindowList();
369 aura::Window::Windows::const_reverse_iterator iter = 369 aura::Window::Windows::const_reverse_iterator iter =
370 std::find(windows.rbegin(), windows.rend(), window); 370 std::find(windows.rbegin(), windows.rend(), window);
371 CHECK(iter != windows.rend()); 371 CHECK(iter != windows.rend());
372 ++iter; 372 ++iter;
373 aura::Window* behind = NULL; 373 aura::Window* behind = nullptr;
374 if (iter != windows.rend()) 374 if (iter != windows.rend())
375 behind = *iter++; 375 behind = *iter++;
376 376
377 if (split_view_controller_->IsSplitViewModeActive()) { 377 if (split_view_controller_->IsSplitViewModeActive()) {
378 aura::Window* left = split_view_controller_->left_window(); 378 aura::Window* left = split_view_controller_->left_window();
379 aura::Window* right = split_view_controller_->right_window(); 379 aura::Window* right = split_view_controller_->right_window();
380 CHECK(window == left || window == right); 380 CHECK(window == left || window == right);
381 if (behind == left || behind == right) 381 if (behind == left || behind == right)
382 behind = (iter == windows.rend()) ? NULL : *iter; 382 behind = (iter == windows.rend()) ? nullptr : *iter;
383 } 383 }
384 384
385 return behind; 385 return behind;
386 } 386 }
387 387
388 void WindowManagerImpl::OnTitleDragStarted(aura::Window* window) { 388 void WindowManagerImpl::OnTitleDragStarted(aura::Window* window) {
389 aura::Window* next_window = GetWindowBehind(window); 389 aura::Window* next_window = GetWindowBehind(window);
390 if (!next_window) 390 if (!next_window)
391 return; 391 return;
392 // Make sure |window| is active. 392 // Make sure |window| is active.
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 DCHECK(!instance); 457 DCHECK(!instance);
458 } 458 }
459 459
460 // static 460 // static
461 WindowManager* WindowManager::Get() { 461 WindowManager* WindowManager::Get() {
462 DCHECK(instance); 462 DCHECK(instance);
463 return instance; 463 return instance;
464 } 464 }
465 465
466 } // namespace athena 466 } // namespace athena
OLDNEW
« no previous file with comments | « athena/wm/window_list_provider_impl_unittest.cc ('k') | athena/wm/window_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698