OLD | NEW |
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> |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 } | 176 } |
177 | 177 |
178 gfx::Rect RootWindowController::CalculateDefaultBounds( | 178 gfx::Rect RootWindowController::CalculateDefaultBounds( |
179 ::ui::Window* window) const { | 179 ::ui::Window* window) const { |
180 if (window->HasSharedProperty( | 180 if (window->HasSharedProperty( |
181 ::ui::mojom::WindowManager::kInitialBounds_Property)) { | 181 ::ui::mojom::WindowManager::kInitialBounds_Property)) { |
182 return window->GetSharedProperty<gfx::Rect>( | 182 return window->GetSharedProperty<gfx::Rect>( |
183 ::ui::mojom::WindowManager::kInitialBounds_Property); | 183 ::ui::mojom::WindowManager::kInitialBounds_Property); |
184 } | 184 } |
185 | 185 |
| 186 if (GetWindowShowState(window) == ui::mojom::ShowState::FULLSCREEN) { |
| 187 return gfx::Rect(0, 0, root_->bounds().width(), root_->bounds().height()); |
| 188 } |
| 189 |
186 int width, height; | 190 int width, height; |
187 const gfx::Size pref = GetWindowPreferredSize(window); | 191 const gfx::Size pref = GetWindowPreferredSize(window); |
188 if (pref.IsEmpty()) { | 192 if (pref.IsEmpty()) { |
189 width = root_->bounds().width() - 240; | 193 width = root_->bounds().width() - 240; |
190 height = root_->bounds().height() - 240; | 194 height = root_->bounds().height() - 240; |
191 } else { | 195 } else { |
192 // TODO(sky): likely want to constrain more than root size. | 196 // TODO(sky): likely want to constrain more than root size. |
193 const gfx::Size max_size = root_->bounds().size(); | 197 const gfx::Size max_size = root_->bounds().size(); |
194 width = std::max(0, std::min(max_size.width(), pref.width())); | 198 width = std::max(0, std::min(max_size.width(), pref.width())); |
195 height = std::max(0, std::min(max_size.height(), pref.height())); | 199 height = std::max(0, std::min(max_size.height(), pref.height())); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 base::WrapUnique(new DockedWindowLayoutManager(docked_container))); | 261 base::WrapUnique(new DockedWindowLayoutManager(docked_container))); |
258 | 262 |
259 WmWindowMus* panel_container = | 263 WmWindowMus* panel_container = |
260 GetWindowByShellWindowId(kShellWindowId_PanelContainer); | 264 GetWindowByShellWindowId(kShellWindowId_PanelContainer); |
261 panel_container->SetLayoutManager( | 265 panel_container->SetLayoutManager( |
262 base::WrapUnique(new PanelLayoutManager(panel_container))); | 266 base::WrapUnique(new PanelLayoutManager(panel_container))); |
263 } | 267 } |
264 | 268 |
265 } // namespace mus | 269 } // namespace mus |
266 } // namespace ash | 270 } // namespace ash |
OLD | NEW |