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 <map> | 9 #include <map> |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
173 } | 173 } |
174 | 174 |
175 gfx::Rect RootWindowController::CalculateDefaultBounds( | 175 gfx::Rect RootWindowController::CalculateDefaultBounds( |
176 ::ui::Window* window) const { | 176 ::ui::Window* window) const { |
177 if (window->HasSharedProperty( | 177 if (window->HasSharedProperty( |
178 ::ui::mojom::WindowManager::kInitialBounds_Property)) { | 178 ::ui::mojom::WindowManager::kInitialBounds_Property)) { |
179 return window->GetSharedProperty<gfx::Rect>( | 179 return window->GetSharedProperty<gfx::Rect>( |
180 ::ui::mojom::WindowManager::kInitialBounds_Property); | 180 ::ui::mojom::WindowManager::kInitialBounds_Property); |
181 } | 181 } |
182 | 182 |
183 if (window->HasSharedProperty( | |
184 ::ui::mojom::WindowManager::kShowState_Property) && | |
185 static_cast<::ui::mojom::ShowState>(window->GetSharedProperty<int32_t>( | |
186 ::ui::mojom::WindowManager::kShowState_Property)) == | |
187 ui::mojom::ShowState::FULLSCREEN) { | |
188 return gfx::Rect(0, 0, root_->bounds().width(), root_->bounds().height()); | |
sadrul
2016/07/15 15:01:10
Can you add a test for this code here?
Add a TODO
riajiang
2016/07/15 17:01:27
Added a test in window_mananger_unittest for creat
| |
189 } | |
190 | |
183 int width, height; | 191 int width, height; |
184 const gfx::Size pref = GetWindowPreferredSize(window); | 192 const gfx::Size pref = GetWindowPreferredSize(window); |
185 if (pref.IsEmpty()) { | 193 if (pref.IsEmpty()) { |
186 width = root_->bounds().width() - 240; | 194 width = root_->bounds().width() - 240; |
187 height = root_->bounds().height() - 240; | 195 height = root_->bounds().height() - 240; |
188 } else { | 196 } else { |
189 // TODO(sky): likely want to constrain more than root size. | 197 // TODO(sky): likely want to constrain more than root size. |
190 const gfx::Size max_size = root_->bounds().size(); | 198 const gfx::Size max_size = root_->bounds().size(); |
191 width = std::max(0, std::min(max_size.width(), pref.width())); | 199 width = std::max(0, std::min(max_size.width(), pref.width())); |
192 height = std::max(0, std::min(max_size.height(), pref.height())); | 200 height = std::max(0, std::min(max_size.height(), pref.height())); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
254 base::WrapUnique(new DockedWindowLayoutManager(docked_container))); | 262 base::WrapUnique(new DockedWindowLayoutManager(docked_container))); |
255 | 263 |
256 WmWindowMus* panel_container = | 264 WmWindowMus* panel_container = |
257 GetWindowByShellWindowId(kShellWindowId_PanelContainer); | 265 GetWindowByShellWindowId(kShellWindowId_PanelContainer); |
258 panel_container->SetLayoutManager( | 266 panel_container->SetLayoutManager( |
259 base::WrapUnique(new PanelLayoutManager(panel_container))); | 267 base::WrapUnique(new PanelLayoutManager(panel_container))); |
260 } | 268 } |
261 | 269 |
262 } // namespace mus | 270 } // namespace mus |
263 } // namespace ash | 271 } // namespace ash |
OLD | NEW |