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

Side by Side Diff: ui/views/mus/desktop_window_tree_host_mus.cc

Issue 2582823002: WIP: Surface Synchronization System
Patch Set: Only create ClientSurfaceEmbedder if window is visible. Trash it otherwise. Created 3 years, 11 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
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 "ui/views/mus/desktop_window_tree_host_mus.h" 5 #include "ui/views/mus/desktop_window_tree_host_mus.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/threading/thread_task_runner_handle.h" 8 #include "base/threading/thread_task_runner_handle.h"
9 #include "ui/aura/client/aura_constants.h" 9 #include "ui/aura/client/aura_constants.h"
10 #include "ui/aura/client/cursor_client.h" 10 #include "ui/aura/client/cursor_client.h"
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 694
695 void DesktopWindowTreeHostMus::HideImpl() { 695 void DesktopWindowTreeHostMus::HideImpl() {
696 native_widget_delegate_->OnNativeWidgetVisibilityChanging(false); 696 native_widget_delegate_->OnNativeWidgetVisibilityChanging(false);
697 WindowTreeHostMus::HideImpl(); 697 WindowTreeHostMus::HideImpl();
698 window()->Hide(); 698 window()->Hide();
699 native_widget_delegate_->OnNativeWidgetVisibilityChanged(false); 699 native_widget_delegate_->OnNativeWidgetVisibilityChanged(false);
700 } 700 }
701 701
702 void DesktopWindowTreeHostMus::SetBoundsInPixels( 702 void DesktopWindowTreeHostMus::SetBoundsInPixels(
703 const gfx::Rect& bounds_in_pixels) { 703 const gfx::Rect& bounds_in_pixels) {
704 fprintf(
705 stderr,
706 ">>>[%d] DesktopWindowTreeHostMus::SetBoundsInPixels(%d, %d, %d, %d)\n",
707 aura::WindowPortMus::Get(window())->server_id(), bounds_in_pixels.x(),
708 bounds_in_pixels.y(), bounds_in_pixels.width(),
709 bounds_in_pixels.height());
704 gfx::Rect final_bounds_in_pixels = bounds_in_pixels; 710 gfx::Rect final_bounds_in_pixels = bounds_in_pixels;
705 if (GetBoundsInPixels().size() != bounds_in_pixels.size()) { 711 if (GetBoundsInPixels().size() != bounds_in_pixels.size()) {
706 gfx::Size size = bounds_in_pixels.size(); 712 gfx::Size size = bounds_in_pixels.size();
707 size.SetToMax(gfx::ConvertSizeToPixel( 713 size.SetToMax(gfx::ConvertSizeToPixel(
708 GetScaleFactor(), native_widget_delegate_->GetMinimumSize())); 714 GetScaleFactor(), native_widget_delegate_->GetMinimumSize()));
709 const gfx::Size max_size_in_pixels = gfx::ConvertSizeToPixel( 715 const gfx::Size max_size_in_pixels = gfx::ConvertSizeToPixel(
710 GetScaleFactor(), native_widget_delegate_->GetMaximumSize()); 716 GetScaleFactor(), native_widget_delegate_->GetMaximumSize());
711 if (!max_size_in_pixels.IsEmpty()) 717 if (!max_size_in_pixels.IsEmpty())
712 size.SetToMin(max_size_in_pixels); 718 size.SetToMin(max_size_in_pixels);
713 final_bounds_in_pixels.set_size(size); 719 final_bounds_in_pixels.set_size(size);
(...skipping 12 matching lines...) Expand all
726 aura::client::FocusClient* focus_client, 732 aura::client::FocusClient* focus_client,
727 aura::Window* window) { 733 aura::Window* window) {
728 if (window == this->window()) { 734 if (window == this->window()) {
729 desktop_native_widget_aura_->HandleActivationChanged(true); 735 desktop_native_widget_aura_->HandleActivationChanged(true);
730 } else if (is_active_) { 736 } else if (is_active_) {
731 desktop_native_widget_aura_->HandleActivationChanged(false); 737 desktop_native_widget_aura_->HandleActivationChanged(false);
732 } 738 }
733 } 739 }
734 740
735 } // namespace views 741 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698