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

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

Issue 2625873007: Promotes WmWindowMus functions to WmWindowAura and nukes WmWindowMus (Closed)
Patch Set: merge Created 3 years, 11 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/root_window_controller.h ('k') | ash/mus/test/ash_test_impl_mus.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/root_window_controller.h" 5 #include "ash/mus/root_window_controller.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <map> 10 #include <map>
11 #include <sstream> 11 #include <sstream>
12 #include <string> 12 #include <string>
13 #include <utility> 13 #include <utility>
14 #include <vector> 14 #include <vector>
15 15
16 #include "ash/aura/wm_window_aura.h"
16 #include "ash/common/shelf/shelf_layout_manager.h" 17 #include "ash/common/shelf/shelf_layout_manager.h"
17 #include "ash/common/shelf/wm_shelf.h" 18 #include "ash/common/shelf/wm_shelf.h"
18 #include "ash/common/wm/container_finder.h" 19 #include "ash/common/wm/container_finder.h"
19 #include "ash/common/wm/dock/docked_window_layout_manager.h" 20 #include "ash/common/wm/dock/docked_window_layout_manager.h"
20 #include "ash/common/wm/panels/panel_layout_manager.h" 21 #include "ash/common/wm/panels/panel_layout_manager.h"
21 #include "ash/common/wm/root_window_layout_manager.h" 22 #include "ash/common/wm/root_window_layout_manager.h"
22 #include "ash/mus/bridge/wm_shell_mus.h" 23 #include "ash/mus/bridge/wm_shell_mus.h"
23 #include "ash/mus/bridge/wm_window_mus.h"
24 #include "ash/mus/non_client_frame_controller.h" 24 #include "ash/mus/non_client_frame_controller.h"
25 #include "ash/mus/property_util.h" 25 #include "ash/mus/property_util.h"
26 #include "ash/mus/screen_mus.h" 26 #include "ash/mus/screen_mus.h"
27 #include "ash/mus/window_manager.h" 27 #include "ash/mus/window_manager.h"
28 #include "ash/public/cpp/shell_window_ids.h" 28 #include "ash/public/cpp/shell_window_ids.h"
29 #include "ash/root_window_settings.h" 29 #include "ash/root_window_settings.h"
30 #include "base/bind.h" 30 #include "base/bind.h"
31 #include "base/command_line.h" 31 #include "base/command_line.h"
32 #include "base/memory/ptr_util.h" 32 #include "base/memory/ptr_util.h"
33 #include "mojo/public/cpp/bindings/type_converter.h" 33 #include "mojo/public/cpp/bindings/type_converter.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 for (auto& property_pair : *properties) { 154 for (auto& property_pair : *properties) {
155 property_converter->SetPropertyFromTransportValue( 155 property_converter->SetPropertyFromTransportValue(
156 window, property_pair.first, &property_pair.second); 156 window, property_pair.first, &property_pair.second);
157 } 157 }
158 window->Init(ui::LAYER_TEXTURED); 158 window->Init(ui::LAYER_TEXTURED);
159 window->SetBounds(bounds); 159 window->SetBounds(bounds);
160 160
161 if (container_window) { 161 if (container_window) {
162 container_window->AddChild(window); 162 container_window->AddChild(window);
163 } else { 163 } else {
164 WmWindowMus* root = WmWindowMus::Get(this->root()); 164 WmWindowAura* root = WmWindowAura::Get(this->root());
165 gfx::Point origin = 165 gfx::Point origin =
166 root->ConvertPointToTarget(root->GetRootWindow(), gfx::Point()); 166 root->ConvertPointToTarget(root->GetRootWindow(), gfx::Point());
167 origin += display_.bounds().OffsetFromOrigin(); 167 origin += display_.bounds().OffsetFromOrigin();
168 gfx::Rect bounds_in_screen(origin, bounds.size()); 168 gfx::Rect bounds_in_screen(origin, bounds.size());
169 static_cast<WmWindowMus*>( 169 static_cast<WmWindowAura*>(
170 ash::wm::GetDefaultParent(WmWindowMus::Get(context), 170 ash::wm::GetDefaultParent(WmWindowAura::Get(context),
171 WmWindowMus::Get(window), bounds_in_screen)) 171 WmWindowAura::Get(window), bounds_in_screen))
172 ->aura_window() 172 ->aura_window()
173 ->AddChild(window); 173 ->AddChild(window);
174 } 174 }
175 return window; 175 return window;
176 } 176 }
177 177
178 WmWindowMus* RootWindowController::GetWindowByShellWindowId(int id) { 178 ash::WmWindowAura* RootWindowController::GetWindowByShellWindowId(int id) {
179 return WmWindowMus::AsWmWindowMus( 179 return static_cast<WmWindowAura*>(
180 WmWindowMus::Get(root())->GetChildByShellWindowId(id)); 180 WmWindowAura::Get(root())->GetChildByShellWindowId(id));
181 } 181 }
182 182
183 void RootWindowController::SetWorkAreaInests(const gfx::Insets& insets) { 183 void RootWindowController::SetWorkAreaInests(const gfx::Insets& insets) {
184 gfx::Rect old_work_area = display_.work_area(); 184 gfx::Rect old_work_area = display_.work_area();
185 display_.UpdateWorkAreaFromInsets(insets); 185 display_.UpdateWorkAreaFromInsets(insets);
186 186
187 if (old_work_area == display_.work_area()) 187 if (old_work_area == display_.work_area())
188 return; 188 return;
189 189
190 window_manager_->screen()->display_list().UpdateDisplay(display_); 190 window_manager_->screen()->display_list().UpdateDisplay(display_);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 } else { 235 } else {
236 width = root()->bounds().width() - 240; 236 width = root()->bounds().width() - 240;
237 height = root()->bounds().height() - 240; 237 height = root()->bounds().height() - 240;
238 } 238 }
239 return gfx::Rect(40 + (window_count_ % 4) * 40, 40 + (window_count_ % 4) * 40, 239 return gfx::Rect(40 + (window_count_ % 4) * 40, 40 + (window_count_ % 4) * 40,
240 width, height); 240 width, height);
241 } 241 }
242 242
243 } // namespace mus 243 } // namespace mus
244 } // namespace ash 244 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/root_window_controller.h ('k') | ash/mus/test/ash_test_impl_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698