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

Side by Side Diff: ash/wm/panels/panel_window_resizer.cc

Issue 36473003: Rename StackingClient -> WindowTreeClient (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: done. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « ash/wm/panels/panel_layout_manager.cc ('k') | ash/wm/stacking_controller.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/panels/panel_window_resizer.h" 5 #include "ash/wm/panels/panel_window_resizer.h"
6 6
7 #include "ash/display/display_controller.h" 7 #include "ash/display/display_controller.h"
8 #include "ash/launcher/launcher.h" 8 #include "ash/launcher/launcher.h"
9 #include "ash/screen_ash.h" 9 #include "ash/screen_ash.h"
10 #include "ash/shelf/shelf_types.h" 10 #include "ash/shelf/shelf_types.h"
11 #include "ash/shelf/shelf_widget.h" 11 #include "ash/shelf/shelf_widget.h"
12 #include "ash/shell.h" 12 #include "ash/shell.h"
13 #include "ash/shell_window_ids.h" 13 #include "ash/shell_window_ids.h"
14 #include "ash/wm/coordinate_conversion.h" 14 #include "ash/wm/coordinate_conversion.h"
15 #include "ash/wm/panels/panel_layout_manager.h" 15 #include "ash/wm/panels/panel_layout_manager.h"
16 #include "ash/wm/window_state.h" 16 #include "ash/wm/window_state.h"
17 #include "ash/wm/window_util.h" 17 #include "ash/wm/window_util.h"
18 #include "base/memory/weak_ptr.h" 18 #include "base/memory/weak_ptr.h"
19 #include "ui/aura/client/aura_constants.h" 19 #include "ui/aura/client/aura_constants.h"
20 #include "ui/aura/client/window_tree_client.h"
20 #include "ui/aura/env.h" 21 #include "ui/aura/env.h"
21 #include "ui/aura/root_window.h" 22 #include "ui/aura/root_window.h"
22 #include "ui/aura/window.h" 23 #include "ui/aura/window.h"
23 #include "ui/aura/window_delegate.h" 24 #include "ui/aura/window_delegate.h"
24 #include "ui/base/hit_test.h" 25 #include "ui/base/hit_test.h"
25 #include "ui/base/ui_base_types.h" 26 #include "ui/base/ui_base_types.h"
26 #include "ui/gfx/screen.h" 27 #include "ui/gfx/screen.h"
27 #include "ui/views/widget/widget.h" 28 #include "ui/views/widget/widget.h"
28 29
29 namespace ash { 30 namespace ash {
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 // Tell the panel layout manager that we are dragging this panel before 189 // Tell the panel layout manager that we are dragging this panel before
189 // attaching it so that it does not get repositioned. 190 // attaching it so that it does not get repositioned.
190 if (panel_container_) 191 if (panel_container_)
191 GetPanelLayoutManager(panel_container_)->StartDragging(GetTarget()); 192 GetPanelLayoutManager(panel_container_)->StartDragging(GetTarget());
192 if (!was_attached_) { 193 if (!was_attached_) {
193 // Attach the panel while dragging placing it in front of other panels. 194 // Attach the panel while dragging placing it in front of other panels.
194 wm::GetWindowState(GetTarget())->set_continue_drag_after_reparent(true); 195 wm::GetWindowState(GetTarget())->set_continue_drag_after_reparent(true);
195 wm::GetWindowState(GetTarget())->set_panel_attached(true); 196 wm::GetWindowState(GetTarget())->set_panel_attached(true);
196 // We use root window coordinates to ensure that during the drag the panel 197 // We use root window coordinates to ensure that during the drag the panel
197 // is reparented to a container in the root window that has that window. 198 // is reparented to a container in the root window that has that window.
198 GetTarget()->SetDefaultParentByRootWindow( 199 aura::Window* target = GetTarget();
199 GetTarget()->GetRootWindow(), 200 aura::RootWindow* target_root = target->GetRootWindow();
200 GetTarget()->GetRootWindow()->GetBoundsInScreen()); 201 aura::client::ParentWindowWithContext(
201 wm::ReparentTransientChildrenOfChild(GetTarget()->parent(), GetTarget()); 202 target, target_root, target_root->GetBoundsInScreen());
203 wm::ReparentTransientChildrenOfChild(target->parent(), target);
202 } 204 }
203 } 205 }
204 206
205 void PanelWindowResizer::FinishDragging() { 207 void PanelWindowResizer::FinishDragging() {
206 if (!did_move_or_resize_) 208 if (!did_move_or_resize_)
207 return; 209 return;
208 if (wm::GetWindowState(GetTarget())->panel_attached() != should_attach_) { 210 if (wm::GetWindowState(GetTarget())->panel_attached() != should_attach_) {
209 wm::GetWindowState(GetTarget())->set_panel_attached(should_attach_); 211 wm::GetWindowState(GetTarget())->set_panel_attached(should_attach_);
210 // We use last known location to ensure that after the drag the panel 212 // We use last known location to ensure that after the drag the panel
211 // is reparented to a container in the root window that has that location. 213 // is reparented to a container in the root window that has that location.
212 GetTarget()->SetDefaultParentByRootWindow( 214 aura::Window* target = GetTarget();
213 GetTarget()->GetRootWindow(), 215 aura::RootWindow* target_root = target->GetRootWindow();
214 gfx::Rect(last_location_, gfx::Size())); 216 aura::client::ParentWindowWithContext(
215 wm::ReparentTransientChildrenOfChild(GetTarget()->parent(), GetTarget()); 217 target, target_root, gfx::Rect(last_location_, gfx::Size()));
218 wm::ReparentTransientChildrenOfChild(target->parent(), GetTarget());
216 } 219 }
217 220
218 // If we started the drag in one root window and moved into another root 221 // If we started the drag in one root window and moved into another root
219 // but then canceled the drag we may need to inform the original layout 222 // but then canceled the drag we may need to inform the original layout
220 // manager that the drag is finished. 223 // manager that the drag is finished.
221 if (initial_panel_container_ != panel_container_) 224 if (initial_panel_container_ != panel_container_)
222 GetPanelLayoutManager(initial_panel_container_)->FinishDragging(); 225 GetPanelLayoutManager(initial_panel_container_)->FinishDragging();
223 if (panel_container_) 226 if (panel_container_)
224 GetPanelLayoutManager(panel_container_)->FinishDragging(); 227 GetPanelLayoutManager(panel_container_)->FinishDragging();
225 } 228 }
226 229
227 void PanelWindowResizer::UpdateLauncherPosition() { 230 void PanelWindowResizer::UpdateLauncherPosition() {
228 if (panel_container_) { 231 if (panel_container_) {
229 GetPanelLayoutManager(panel_container_)->launcher()-> 232 GetPanelLayoutManager(panel_container_)->launcher()->
230 UpdateIconPositionForWindow(GetTarget()); 233 UpdateIconPositionForWindow(GetTarget());
231 } 234 }
232 } 235 }
233 236
234 } // namespace aura 237 } // namespace aura
OLDNEW
« no previous file with comments | « ash/wm/panels/panel_layout_manager.cc ('k') | ash/wm/stacking_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698