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 (window->HasSharedProperty( | |
187 ::ui::mojom::WindowManager::kShowState_Property) && | |
188 static_cast<::ui::mojom::ShowState>(window->GetSharedProperty<int32_t>( | |
sky
2016/07/21 20:00:02
Use GetWindowShowState in property_util
riajiang
2016/07/21 20:13:51
Done.
| |
189 ::ui::mojom::WindowManager::kShowState_Property)) == | |
190 ui::mojom::ShowState::FULLSCREEN) { | |
191 return gfx::Rect(0, 0, root_->bounds().width(), root_->bounds().height()); | |
192 } | |
193 | |
186 int width, height; | 194 int width, height; |
187 const gfx::Size pref = GetWindowPreferredSize(window); | 195 const gfx::Size pref = GetWindowPreferredSize(window); |
188 if (pref.IsEmpty()) { | 196 if (pref.IsEmpty()) { |
189 width = root_->bounds().width() - 240; | 197 width = root_->bounds().width() - 240; |
190 height = root_->bounds().height() - 240; | 198 height = root_->bounds().height() - 240; |
191 } else { | 199 } else { |
192 // TODO(sky): likely want to constrain more than root size. | 200 // TODO(sky): likely want to constrain more than root size. |
193 const gfx::Size max_size = root_->bounds().size(); | 201 const gfx::Size max_size = root_->bounds().size(); |
194 width = std::max(0, std::min(max_size.width(), pref.width())); | 202 width = std::max(0, std::min(max_size.width(), pref.width())); |
195 height = std::max(0, std::min(max_size.height(), pref.height())); | 203 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))); | 265 base::WrapUnique(new DockedWindowLayoutManager(docked_container))); |
258 | 266 |
259 WmWindowMus* panel_container = | 267 WmWindowMus* panel_container = |
260 GetWindowByShellWindowId(kShellWindowId_PanelContainer); | 268 GetWindowByShellWindowId(kShellWindowId_PanelContainer); |
261 panel_container->SetLayoutManager( | 269 panel_container->SetLayoutManager( |
262 base::WrapUnique(new PanelLayoutManager(panel_container))); | 270 base::WrapUnique(new PanelLayoutManager(panel_container))); |
263 } | 271 } |
264 | 272 |
265 } // namespace mus | 273 } // namespace mus |
266 } // namespace ash | 274 } // namespace ash |
OLD | NEW |