| 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/mus/window_tree_host_mus.h" | 11 #include "ui/aura/mus/window_tree_host_mus.h" |
| 12 #include "ui/aura/window.h" | 12 #include "ui/aura/window.h" |
| 13 #include "ui/display/screen.h" | 13 #include "ui/display/screen.h" |
| 14 #include "ui/views/corewm/tooltip_aura.h" | 14 #include "ui/views/corewm/tooltip_aura.h" |
| 15 #include "ui/views/mus/mus_client.h" | 15 #include "ui/views/mus/mus_client.h" |
| 16 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" | 16 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
| 17 #include "ui/views/widget/native_widget_aura.h" | |
| 18 #include "ui/views/widget/widget_delegate.h" | 17 #include "ui/views/widget/widget_delegate.h" |
| 19 #include "ui/wm/core/window_util.h" | 18 #include "ui/wm/core/window_util.h" |
| 20 #include "ui/wm/public/activation_client.h" | 19 #include "ui/wm/public/activation_client.h" |
| 21 | 20 |
| 22 namespace views { | 21 namespace views { |
| 23 | 22 |
| 24 DesktopWindowTreeHostMus::DesktopWindowTreeHostMus( | 23 DesktopWindowTreeHostMus::DesktopWindowTreeHostMus( |
| 25 internal::NativeWidgetDelegate* native_widget_delegate, | 24 internal::NativeWidgetDelegate* native_widget_delegate, |
| 26 DesktopNativeWidgetAura* desktop_native_widget_aura) | 25 DesktopNativeWidgetAura* desktop_native_widget_aura) |
| 27 : aura::WindowTreeHostMus(MusClient::Get()->window_tree_client()), | 26 : aura::WindowTreeHostMus(MusClient::Get()->window_tree_client()), |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 ui::SHOW_STATE_FULLSCREEN; | 297 ui::SHOW_STATE_FULLSCREEN; |
| 299 } | 298 } |
| 300 void DesktopWindowTreeHostMus::SetOpacity(float opacity) { | 299 void DesktopWindowTreeHostMus::SetOpacity(float opacity) { |
| 301 // TODO: this likely need to go to server so that non-client decorations get | 300 // TODO: this likely need to go to server so that non-client decorations get |
| 302 // opacity. | 301 // opacity. |
| 303 window()->layer()->SetOpacity(opacity); | 302 window()->layer()->SetOpacity(opacity); |
| 304 } | 303 } |
| 305 | 304 |
| 306 void DesktopWindowTreeHostMus::SetWindowIcons(const gfx::ImageSkia& window_icon, | 305 void DesktopWindowTreeHostMus::SetWindowIcons(const gfx::ImageSkia& window_icon, |
| 307 const gfx::ImageSkia& app_icon) { | 306 const gfx::ImageSkia& app_icon) { |
| 308 NativeWidgetAura::AssignIconToAuraWindow(window(), window_icon, app_icon); | 307 if (window_icon.isNull() && app_icon.isNull()) { |
| 308 window()->ClearProperty(aura::client::kWindowIconKey); |
| 309 return; |
| 310 } |
| 311 |
| 312 window()->SetProperty( |
| 313 aura::client::kWindowIconKey, |
| 314 new gfx::ImageSkia(!window_icon.isNull() ? window_icon : app_icon)); |
| 309 } | 315 } |
| 310 | 316 |
| 311 void DesktopWindowTreeHostMus::InitModalType(ui::ModalType modal_type) { | 317 void DesktopWindowTreeHostMus::InitModalType(ui::ModalType modal_type) { |
| 312 window()->SetProperty(aura::client::kModalKey, modal_type); | 318 window()->SetProperty(aura::client::kModalKey, modal_type); |
| 313 } | 319 } |
| 314 | 320 |
| 315 void DesktopWindowTreeHostMus::FlashFrame(bool flash_frame) { | 321 void DesktopWindowTreeHostMus::FlashFrame(bool flash_frame) { |
| 316 window()->SetProperty(aura::client::kDrawAttentionKey, flash_frame); | 322 window()->SetProperty(aura::client::kDrawAttentionKey, flash_frame); |
| 317 } | 323 } |
| 318 | 324 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 330 Widget* widget = native_widget_delegate_->AsWidget(); | 336 Widget* widget = native_widget_delegate_->AsWidget(); |
| 331 window()->SetProperty(aura::client::kCanMaximizeKey, | 337 window()->SetProperty(aura::client::kCanMaximizeKey, |
| 332 widget->widget_delegate()->CanMaximize()); | 338 widget->widget_delegate()->CanMaximize()); |
| 333 window()->SetProperty(aura::client::kCanMinimizeKey, | 339 window()->SetProperty(aura::client::kCanMinimizeKey, |
| 334 widget->widget_delegate()->CanMinimize()); | 340 widget->widget_delegate()->CanMinimize()); |
| 335 window()->SetProperty(aura::client::kCanResizeKey, | 341 window()->SetProperty(aura::client::kCanResizeKey, |
| 336 widget->widget_delegate()->CanResize()); | 342 widget->widget_delegate()->CanResize()); |
| 337 } | 343 } |
| 338 | 344 |
| 339 } // namespace views | 345 } // namespace views |
| OLD | NEW |