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

Side by Side Diff: ash/common/wm/dock/docked_window_layout_manager.cc

Issue 2737213002: Update window_parenting_utils to use aura::window (Closed)
Patch Set: fix Created 3 years, 9 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/common/wm/dock/docked_window_layout_manager.h" 5 #include "ash/common/wm/dock/docked_window_layout_manager.h"
6 6
7 #include "ash/animation/animation_change_type.h" 7 #include "ash/animation/animation_change_type.h"
8 #include "ash/common/shelf/shelf_background_animator.h" 8 #include "ash/common/shelf/shelf_background_animator.h"
9 #include "ash/common/shelf/shelf_background_animator_observer.h" 9 #include "ash/common/shelf/shelf_background_animator_observer.h"
10 #include "ash/common/shelf/shelf_constants.h" 10 #include "ash/common/shelf/shelf_constants.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 bool IsWindowDocked(const WmWindow* window) { 177 bool IsWindowDocked(const WmWindow* window) {
178 return (window->IsVisible() && !window->GetWindowState()->IsMinimized() && 178 return (window->IsVisible() && !window->GetWindowState()->IsMinimized() &&
179 !IsPopupOrTransient(window)); 179 !IsPopupOrTransient(window));
180 } 180 }
181 181
182 void UndockWindow(WmWindow* window) { 182 void UndockWindow(WmWindow* window) {
183 gfx::Rect previous_bounds = window->GetBounds(); 183 gfx::Rect previous_bounds = window->GetBounds();
184 WmWindow* old_parent = window->GetParent(); 184 WmWindow* old_parent = window->GetParent();
185 window->SetParentUsingContext(window, gfx::Rect()); 185 window->SetParentUsingContext(window, gfx::Rect());
186 if (window->GetParent() != old_parent) { 186 if (window->GetParent() != old_parent) {
187 wm::ReparentTransientChildrenOfChild(window, old_parent, 187 wm::ReparentTransientChildrenOfChild(window->aura_window(),
188 window->GetParent()); 188 old_parent->aura_window(),
sky 2017/03/09 20:57:45 Similar comment about nullness for old_parent and
yiyix 2017/03/09 22:00:15 Done.
189 window->GetParent()->aura_window());
189 } 190 }
190 // Start maximize or fullscreen (affecting packaged apps) animation from 191 // Start maximize or fullscreen (affecting packaged apps) animation from
191 // previous window bounds. 192 // previous window bounds.
192 window->GetLayer()->SetBounds(previous_bounds); 193 window->GetLayer()->SetBounds(previous_bounds);
193 } 194 }
194 195
195 // Returns width that is as close as possible to |target_width| while being 196 // Returns width that is as close as possible to |target_width| while being
196 // consistent with docked min and max restrictions and respects the |window|'s 197 // consistent with docked min and max restrictions and respects the |window|'s
197 // minimum and maximum size. 198 // minimum and maximum size.
198 int GetWindowWidthCloseTo(const WmWindow* window, int target_width) { 199 int GetWindowWidthCloseTo(const WmWindow* window, int target_width) {
(...skipping 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after
1332 const gfx::Rect& keyboard_bounds) { 1333 const gfx::Rect& keyboard_bounds) {
1333 // This bounds change will have caused a change to the Shelf which does not 1334 // This bounds change will have caused a change to the Shelf which does not
1334 // propagate automatically to this class, so manually recalculate bounds. 1335 // propagate automatically to this class, so manually recalculate bounds.
1335 Relayout(); 1336 Relayout();
1336 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); 1337 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING);
1337 } 1338 }
1338 1339
1339 void DockedWindowLayoutManager::OnKeyboardClosed() {} 1340 void DockedWindowLayoutManager::OnKeyboardClosed() {}
1340 1341
1341 } // namespace ash 1342 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698