| 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" |
| 11 #include "ui/aura/env.h" | 11 #include "ui/aura/env.h" |
| 12 #include "ui/aura/mus/window_tree_host_mus.h" | 12 #include "ui/aura/mus/window_tree_host_mus.h" |
| 13 #include "ui/aura/window.h" | 13 #include "ui/aura/window.h" |
| 14 #include "ui/display/screen.h" | 14 #include "ui/display/screen.h" |
| 15 #include "ui/views/corewm/tooltip_aura.h" | 15 #include "ui/views/corewm/tooltip_aura.h" |
| 16 #include "ui/views/mus/mus_client.h" | 16 #include "ui/views/mus/mus_client.h" |
| 17 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" | 17 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
| 18 #include "ui/views/widget/native_widget_aura.h" |
| 18 #include "ui/views/widget/widget_delegate.h" | 19 #include "ui/views/widget/widget_delegate.h" |
| 19 #include "ui/wm/core/window_util.h" | 20 #include "ui/wm/core/window_util.h" |
| 20 #include "ui/wm/public/activation_client.h" | 21 #include "ui/wm/public/activation_client.h" |
| 21 | 22 |
| 22 namespace views { | 23 namespace views { |
| 23 | 24 |
| 24 DesktopWindowTreeHostMus::DesktopWindowTreeHostMus( | 25 DesktopWindowTreeHostMus::DesktopWindowTreeHostMus( |
| 25 internal::NativeWidgetDelegate* native_widget_delegate, | 26 internal::NativeWidgetDelegate* native_widget_delegate, |
| 26 DesktopNativeWidgetAura* desktop_native_widget_aura) | 27 DesktopNativeWidgetAura* desktop_native_widget_aura) |
| 27 : aura::WindowTreeHostMus(MusClient::Get()->window_tree_client()), | 28 : aura::WindowTreeHostMus(MusClient::Get()->window_tree_client()), |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 ui::SHOW_STATE_FULLSCREEN; | 322 ui::SHOW_STATE_FULLSCREEN; |
| 322 } | 323 } |
| 323 void DesktopWindowTreeHostMus::SetOpacity(float opacity) { | 324 void DesktopWindowTreeHostMus::SetOpacity(float opacity) { |
| 324 // TODO: this likely need to go to server so that non-client decorations get | 325 // TODO: this likely need to go to server so that non-client decorations get |
| 325 // opacity. | 326 // opacity. |
| 326 window()->layer()->SetOpacity(opacity); | 327 window()->layer()->SetOpacity(opacity); |
| 327 } | 328 } |
| 328 | 329 |
| 329 void DesktopWindowTreeHostMus::SetWindowIcons(const gfx::ImageSkia& window_icon, | 330 void DesktopWindowTreeHostMus::SetWindowIcons(const gfx::ImageSkia& window_icon, |
| 330 const gfx::ImageSkia& app_icon) { | 331 const gfx::ImageSkia& app_icon) { |
| 331 if (window_icon.isNull() && app_icon.isNull()) { | 332 NativeWidgetAura::AssignIconToAuraWindow(window(), window_icon, app_icon); |
| 332 window()->ClearProperty(aura::client::kWindowIconKey); | |
| 333 return; | |
| 334 } | |
| 335 | |
| 336 window()->SetProperty( | |
| 337 aura::client::kWindowIconKey, | |
| 338 new gfx::ImageSkia(!window_icon.isNull() ? window_icon : app_icon)); | |
| 339 } | 333 } |
| 340 | 334 |
| 341 void DesktopWindowTreeHostMus::InitModalType(ui::ModalType modal_type) { | 335 void DesktopWindowTreeHostMus::InitModalType(ui::ModalType modal_type) { |
| 342 window()->SetProperty(aura::client::kModalKey, modal_type); | 336 window()->SetProperty(aura::client::kModalKey, modal_type); |
| 343 } | 337 } |
| 344 | 338 |
| 345 void DesktopWindowTreeHostMus::FlashFrame(bool flash_frame) { | 339 void DesktopWindowTreeHostMus::FlashFrame(bool flash_frame) { |
| 346 window()->SetProperty(aura::client::kDrawAttentionKey, flash_frame); | 340 window()->SetProperty(aura::client::kDrawAttentionKey, flash_frame); |
| 347 } | 341 } |
| 348 | 342 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 374 if (window == this->window()) { | 368 if (window == this->window()) { |
| 375 is_active_ = true; | 369 is_active_ = true; |
| 376 desktop_native_widget_aura_->HandleActivationChanged(true); | 370 desktop_native_widget_aura_->HandleActivationChanged(true); |
| 377 } else if (is_active_) { | 371 } else if (is_active_) { |
| 378 is_active_ = false; | 372 is_active_ = false; |
| 379 desktop_native_widget_aura_->HandleActivationChanged(false); | 373 desktop_native_widget_aura_->HandleActivationChanged(false); |
| 380 } | 374 } |
| 381 } | 375 } |
| 382 | 376 |
| 383 } // namespace views | 377 } // namespace views |
| OLD | NEW |