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

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

Issue 38073004: Not moving a docked window when restoring a previously maximized window (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Not moving a docked window when restoring a previously maximized window (delegating IsDocked to non… Created 7 years, 1 month 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 "ash/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/screen_ash.h" 8 #include "ash/screen_ash.h"
9 #include "ash/shell_window_ids.h" 9 #include "ash/shell_window_ids.h"
10 #include "ash/wm/window_properties.h" 10 #include "ash/wm/window_properties.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 bool WindowState::IsNormalShowState() const { 68 bool WindowState::IsNormalShowState() const {
69 ui::WindowShowState state = window_->GetProperty(aura::client::kShowStateKey); 69 ui::WindowShowState state = window_->GetProperty(aura::client::kShowStateKey);
70 return state == ui::SHOW_STATE_NORMAL || state == ui::SHOW_STATE_DEFAULT; 70 return state == ui::SHOW_STATE_NORMAL || state == ui::SHOW_STATE_DEFAULT;
71 } 71 }
72 72
73 bool WindowState::IsActive() const { 73 bool WindowState::IsActive() const {
74 return IsActiveWindow(window_); 74 return IsActiveWindow(window_);
75 } 75 }
76 76
77 bool WindowState::IsDocked() const {
78 return window_->parent() &&
79 window_->parent()->id() == internal::kShellWindowId_DockedContainer;
80 }
81
77 bool WindowState::CanMaximize() const { 82 bool WindowState::CanMaximize() const {
78 return window_->GetProperty(aura::client::kCanMaximizeKey); 83 return window_->GetProperty(aura::client::kCanMaximizeKey);
79 } 84 }
80 85
81 bool WindowState::CanMinimize() const { 86 bool WindowState::CanMinimize() const {
82 internal::RootWindowController* controller = 87 internal::RootWindowController* controller =
83 internal::RootWindowController::ForWindow(window_); 88 internal::RootWindowController::ForWindow(window_);
84 if (!controller) 89 if (!controller)
85 return false; 90 return false;
86 aura::Window* lockscreen = controller->GetContainer( 91 aura::Window* lockscreen = controller->GetContainer(
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 } 275 }
271 return settings; 276 return settings;
272 } 277 }
273 278
274 const WindowState* GetWindowState(const aura::Window* window) { 279 const WindowState* GetWindowState(const aura::Window* window) {
275 return GetWindowState(const_cast<aura::Window*>(window)); 280 return GetWindowState(const_cast<aura::Window*>(window));
276 } 281 }
277 282
278 } // namespace wm 283 } // namespace wm
279 } // namespace ash 284 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698