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

Side by Side Diff: ash/root_window_controller.cc

Issue 1890713002: Adds WmWindow and converts WindowState to use it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge again Created 4 years, 8 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 | « ash/metrics/user_metrics_recorder.cc ('k') | ash/root_window_controller_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 (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/root_window_controller.h" 5 #include "ash/root_window_controller.h"
6 6
7 #include <queue> 7 #include <queue>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/ash_constants.h" 10 #include "ash/ash_constants.h"
(...skipping 28 matching lines...) Expand all
39 #include "ash/wm/panels/attached_panel_window_targeter.h" 39 #include "ash/wm/panels/attached_panel_window_targeter.h"
40 #include "ash/wm/panels/panel_layout_manager.h" 40 #include "ash/wm/panels/panel_layout_manager.h"
41 #include "ash/wm/panels/panel_window_event_handler.h" 41 #include "ash/wm/panels/panel_window_event_handler.h"
42 #include "ash/wm/root_window_layout_manager.h" 42 #include "ash/wm/root_window_layout_manager.h"
43 #include "ash/wm/stacking_controller.h" 43 #include "ash/wm/stacking_controller.h"
44 #include "ash/wm/status_area_layout_manager.h" 44 #include "ash/wm/status_area_layout_manager.h"
45 #include "ash/wm/system_background_controller.h" 45 #include "ash/wm/system_background_controller.h"
46 #include "ash/wm/system_modal_container_layout_manager.h" 46 #include "ash/wm/system_modal_container_layout_manager.h"
47 #include "ash/wm/window_properties.h" 47 #include "ash/wm/window_properties.h"
48 #include "ash/wm/window_state.h" 48 #include "ash/wm/window_state.h"
49 #include "ash/wm/window_state_aura.h"
49 #include "ash/wm/window_util.h" 50 #include "ash/wm/window_util.h"
50 #include "ash/wm/workspace/workspace_layout_manager.h" 51 #include "ash/wm/workspace/workspace_layout_manager.h"
51 #include "ash/wm/workspace_controller.h" 52 #include "ash/wm/workspace_controller.h"
52 #include "base/command_line.h" 53 #include "base/command_line.h"
53 #include "base/memory/ptr_util.h" 54 #include "base/memory/ptr_util.h"
54 #include "base/time/time.h" 55 #include "base/time/time.h"
55 #include "ui/aura/client/aura_constants.h" 56 #include "ui/aura/client/aura_constants.h"
56 #include "ui/aura/client/screen_position_client.h" 57 #include "ui/aura/client/screen_position_client.h"
57 #include "ui/aura/window.h" 58 #include "ui/aura/window.h"
58 #include "ui/aura/window_delegate.h" 59 #include "ui/aura/window_delegate.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 const gfx::Size dst_size = new_parent->bounds().size(); 127 const gfx::Size dst_size = new_parent->bounds().size();
127 // Update the restore bounds to make it relative to the display. 128 // Update the restore bounds to make it relative to the display.
128 wm::WindowState* state = wm::GetWindowState(window); 129 wm::WindowState* state = wm::GetWindowState(window);
129 gfx::Rect restore_bounds; 130 gfx::Rect restore_bounds;
130 bool has_restore_bounds = state->HasRestoreBounds(); 131 bool has_restore_bounds = state->HasRestoreBounds();
131 132
132 bool update_bounds = (state->IsNormalOrSnapped() || state->IsMinimized()) && 133 bool update_bounds = (state->IsNormalOrSnapped() || state->IsMinimized()) &&
133 new_parent->id() != kShellWindowId_DockedContainer; 134 new_parent->id() != kShellWindowId_DockedContainer;
134 gfx::Rect local_bounds; 135 gfx::Rect local_bounds;
135 if (update_bounds) { 136 if (update_bounds) {
136 local_bounds = state->window()->bounds(); 137 local_bounds = state->aura_window()->bounds();
137 MoveOriginRelativeToSize(src_size, dst_size, &local_bounds); 138 MoveOriginRelativeToSize(src_size, dst_size, &local_bounds);
138 } 139 }
139 140
140 if (has_restore_bounds) { 141 if (has_restore_bounds) {
141 restore_bounds = state->GetRestoreBoundsInParent(); 142 restore_bounds = state->GetRestoreBoundsInParent();
142 MoveOriginRelativeToSize(src_size, dst_size, &restore_bounds); 143 MoveOriginRelativeToSize(src_size, dst_size, &restore_bounds);
143 } 144 }
144 145
145 new_parent->AddChild(window); 146 new_parent->AddChild(window);
146 147
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 else 1083 else
1083 DisableTouchHudProjection(); 1084 DisableTouchHudProjection();
1084 } 1085 }
1085 1086
1086 RootWindowController* GetRootWindowController( 1087 RootWindowController* GetRootWindowController(
1087 const aura::Window* root_window) { 1088 const aura::Window* root_window) {
1088 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; 1089 return root_window ? GetRootWindowSettings(root_window)->controller : NULL;
1089 } 1090 }
1090 1091
1091 } // namespace ash 1092 } // namespace ash
OLDNEW
« no previous file with comments | « ash/metrics/user_metrics_recorder.cc ('k') | ash/root_window_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698