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

Side by Side Diff: services/ui/ws/display.cc

Issue 2491493004: Fix root ServerWindow size. (Closed)
Patch Set: Created 4 years, 1 month 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "services/ui/ws/display.h" 5 #include "services/ui/ws/display.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 window_server_->user_id_tracker()->active_id()) 287 window_server_->user_id_tracker()->active_id())
288 ->OnUserActivity(); 288 ->OnUserActivity();
289 } 289 }
290 290
291 void Display::OnNativeCaptureLost() { 291 void Display::OnNativeCaptureLost() {
292 WindowManagerDisplayRoot* display_root = GetActiveWindowManagerDisplayRoot(); 292 WindowManagerDisplayRoot* display_root = GetActiveWindowManagerDisplayRoot();
293 if (display_root) 293 if (display_root)
294 display_root->window_manager_state()->SetCapture(nullptr, kInvalidClientId); 294 display_root->window_manager_state()->SetCapture(nullptr, kInvalidClientId);
295 } 295 }
296 296
297 void Display::OnViewportMetricsChanged( 297 void Display::UpdateRootWindowSize(const gfx::Size& new_size) {
298 const display::ViewportMetrics& new_metrics) { 298 if (root_->bounds().size() == new_size)
299 if (!root_ || root_->bounds().size() == new_metrics.bounds.size())
300 return; 299 return;
301 300
302 gfx::Rect new_bounds(new_metrics.bounds.size()); 301 gfx::Rect new_bounds(new_size);
303 root_->SetBounds(new_bounds); 302 root_->SetBounds(new_bounds);
304 for (auto& pair : window_manager_display_root_map_) 303 for (auto& pair : window_manager_display_root_map_)
305 pair.second->root()->SetBounds(new_bounds); 304 pair.second->root()->SetBounds(new_bounds);
306 } 305 }
307 306
308 bool Display::CanHaveActiveChildren(ServerWindow* window) const { 307 bool Display::CanHaveActiveChildren(ServerWindow* window) const {
309 return window && activation_parents_.Contains(window); 308 return window && activation_parents_.Contains(window);
310 } 309 }
311 310
312 void Display::OnActivationChanged(ServerWindow* old_active_window, 311 void Display::OnActivationChanged(ServerWindow* old_active_window,
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 } 382 }
384 383
385 void Display::OnWindowManagerWindowTreeFactoryReady( 384 void Display::OnWindowManagerWindowTreeFactoryReady(
386 WindowManagerWindowTreeFactory* factory) { 385 WindowManagerWindowTreeFactory* factory) {
387 if (!binding_) 386 if (!binding_)
388 CreateWindowManagerDisplayRootFromFactory(factory); 387 CreateWindowManagerDisplayRootFromFactory(factory);
389 } 388 }
390 389
391 } // namespace ws 390 } // namespace ws
392 } // namespace ui 391 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698