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

Side by Side Diff: ash/mus/top_level_window_factory.cc

Issue 2739553005: Moves maintaining root_window_for_new_windows_ to Shell (Closed)
Patch Set: remove ash:: 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
« no previous file with comments | « ash/mus/accelerators/accelerator_controller_registrar.cc ('k') | ash/root_window_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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/mus/top_level_window_factory.h" 5 #include "ash/mus/top_level_window_factory.h"
6 6
7 #include "ash/common/wm/container_finder.h" 7 #include "ash/common/wm/container_finder.h"
8 #include "ash/common/wm/window_state.h" 8 #include "ash/common/wm/window_state.h"
9 #include "ash/common/wm_shell.h"
10 #include "ash/common/wm_window.h" 9 #include "ash/common/wm_window.h"
11 #include "ash/mus/disconnected_app_handler.h" 10 #include "ash/mus/disconnected_app_handler.h"
12 #include "ash/mus/frame/detached_title_area_renderer.h" 11 #include "ash/mus/frame/detached_title_area_renderer.h"
13 #include "ash/mus/non_client_frame_controller.h" 12 #include "ash/mus/non_client_frame_controller.h"
14 #include "ash/mus/property_util.h" 13 #include "ash/mus/property_util.h"
15 #include "ash/mus/window_manager.h" 14 #include "ash/mus/window_manager.h"
16 #include "ash/public/cpp/shell_window_ids.h" 15 #include "ash/public/cpp/shell_window_ids.h"
17 #include "ash/root_window_controller.h" 16 #include "ash/root_window_controller.h"
18 #include "ash/root_window_settings.h" 17 #include "ash/root_window_settings.h"
18 #include "ash/shell.h"
19 #include "mojo/public/cpp/bindings/type_converter.h" 19 #include "mojo/public/cpp/bindings/type_converter.h"
20 #include "services/ui/public/cpp/property_type_converters.h" 20 #include "services/ui/public/cpp/property_type_converters.h"
21 #include "services/ui/public/interfaces/window_manager.mojom.h" 21 #include "services/ui/public/interfaces/window_manager.mojom.h"
22 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" 22 #include "services/ui/public/interfaces/window_manager_constants.mojom.h"
23 #include "ui/aura/client/aura_constants.h" 23 #include "ui/aura/client/aura_constants.h"
24 #include "ui/aura/mus/property_converter.h" 24 #include "ui/aura/mus/property_converter.h"
25 #include "ui/aura/mus/property_utils.h" 25 #include "ui/aura/mus/property_utils.h"
26 #include "ui/aura/mus/window_tree_client.h" 26 #include "ui/aura/mus/window_tree_client.h"
27 #include "ui/aura/window.h" 27 #include "ui/aura/window.h"
28 #include "ui/display/display.h" 28 #include "ui/display/display.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 if (display_id != display::kInvalidDisplayId) { 66 if (display_id != display::kInvalidDisplayId) {
67 for (RootWindowController* root_window_controller : 67 for (RootWindowController* root_window_controller :
68 RootWindowController::root_window_controllers()) { 68 RootWindowController::root_window_controllers()) {
69 if (GetRootWindowSettings(root_window_controller->GetRootWindow()) 69 if (GetRootWindowSettings(root_window_controller->GetRootWindow())
70 ->display_id == display_id) { 70 ->display_id == display_id) {
71 return root_window_controller; 71 return root_window_controller;
72 } 72 }
73 } 73 }
74 } 74 }
75 return RootWindowController::ForWindow( 75 return RootWindowController::ForWindow(
76 WmShell::Get()->GetRootWindowForNewWindows()->aura_window()); 76 Shell::GetWmRootWindowForNewWindows()->aura_window());
77 } 77 }
78 78
79 // Returns the bounds for the new window. 79 // Returns the bounds for the new window.
80 gfx::Rect CalculateDefaultBounds( 80 gfx::Rect CalculateDefaultBounds(
81 WindowManager* window_manager, 81 WindowManager* window_manager,
82 RootWindowController* root_window_controller, 82 RootWindowController* root_window_controller,
83 aura::Window* container_window, 83 aura::Window* container_window,
84 const std::map<std::string, std::vector<uint8_t>>* properties) { 84 const std::map<std::string, std::vector<uint8_t>>* properties) {
85 gfx::Rect requested_bounds; 85 gfx::Rect requested_bounds;
86 if (GetInitialBounds(*properties, &requested_bounds)) 86 if (GetInitialBounds(*properties, &requested_bounds))
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 if (non_client_frame_controller) 229 if (non_client_frame_controller)
230 non_client_frame_controller->set_can_activate(can_focus); 230 non_client_frame_controller->set_can_activate(can_focus);
231 // No need to persist this value. 231 // No need to persist this value.
232 properties->erase(focusable_iter); 232 properties->erase(focusable_iter);
233 } 233 }
234 return window; 234 return window;
235 } 235 }
236 236
237 } // namespace mus 237 } // namespace mus
238 } // namespace ash 238 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/accelerators/accelerator_controller_registrar.cc ('k') | ash/root_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698