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

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

Issue 2150933003: mash: Add touch-hud app. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sequence. Created 4 years, 5 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 | « no previous file | ash/touch_hud/mus/BUILD.gn » ('j') | ash/touch_hud/mus/DEPS » ('J')
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 <map> 9 #include <map>
10 #include <sstream> 10 #include <sstream>
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « no previous file | ash/touch_hud/mus/BUILD.gn » ('j') | ash/touch_hud/mus/DEPS » ('J')

Powered by Google App Engine
This is Rietveld 408576698