| 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 "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 "ui/aura/client/aura_constants.h" | 8 #include "ui/aura/client/aura_constants.h" |
| 9 #include "ui/aura/client/drag_drop_client.h" | 9 #include "ui/aura/client/drag_drop_client.h" |
| 10 #include "ui/aura/client/focus_client.h" | 10 #include "ui/aura/client/focus_client.h" |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 // TODO: handle conversion to dips, http://crbug.com/663524. | 386 // TODO: handle conversion to dips, http://crbug.com/663524. |
| 387 gfx::Rect final_bounds_in_pixels = bounds_in_pixels; | 387 gfx::Rect final_bounds_in_pixels = bounds_in_pixels; |
| 388 if (GetBounds().size() != bounds_in_pixels.size()) { | 388 if (GetBounds().size() != bounds_in_pixels.size()) { |
| 389 gfx::Size size = bounds_in_pixels.size(); | 389 gfx::Size size = bounds_in_pixels.size(); |
| 390 size.SetToMax(native_widget_delegate_->GetMinimumSize()); | 390 size.SetToMax(native_widget_delegate_->GetMinimumSize()); |
| 391 const gfx::Size max_size = native_widget_delegate_->GetMaximumSize(); | 391 const gfx::Size max_size = native_widget_delegate_->GetMaximumSize(); |
| 392 if (!max_size.IsEmpty()) | 392 if (!max_size.IsEmpty()) |
| 393 size.SetToMin(max_size); | 393 size.SetToMin(max_size); |
| 394 final_bounds_in_pixels.set_size(size); | 394 final_bounds_in_pixels.set_size(size); |
| 395 } | 395 } |
| 396 WindowTreeHostPlatform::SetBounds(final_bounds_in_pixels); | 396 WindowTreeHostMus::SetBounds(final_bounds_in_pixels); |
| 397 } | 397 } |
| 398 | 398 |
| 399 void DesktopWindowTreeHostMus::OnWindowInitialized(aura::Window* window) {} | 399 void DesktopWindowTreeHostMus::OnWindowInitialized(aura::Window* window) {} |
| 400 | 400 |
| 401 void DesktopWindowTreeHostMus::OnActiveFocusClientChanged( | 401 void DesktopWindowTreeHostMus::OnActiveFocusClientChanged( |
| 402 aura::client::FocusClient* focus_client, | 402 aura::client::FocusClient* focus_client, |
| 403 aura::Window* window) { | 403 aura::Window* window) { |
| 404 if (window == this->window()) { | 404 if (window == this->window()) { |
| 405 is_active_ = true; | 405 is_active_ = true; |
| 406 desktop_native_widget_aura_->HandleActivationChanged(true); | 406 desktop_native_widget_aura_->HandleActivationChanged(true); |
| 407 } else if (is_active_) { | 407 } else if (is_active_) { |
| 408 is_active_ = false; | 408 is_active_ = false; |
| 409 desktop_native_widget_aura_->HandleActivationChanged(false); | 409 desktop_native_widget_aura_->HandleActivationChanged(false); |
| 410 } | 410 } |
| 411 } | 411 } |
| 412 | 412 |
| 413 } // namespace views | 413 } // namespace views |
| OLD | NEW |