| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/widget/desktop_aura/desktop_window_tree_host_win.h" | 5 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_win.h" |
| 6 | 6 |
| 7 #include "base/win/metro.h" | 7 #include "base/win/metro.h" |
| 8 #include "third_party/skia/include/core/SkPath.h" | 8 #include "third_party/skia/include/core/SkPath.h" |
| 9 #include "third_party/skia/include/core/SkRegion.h" | 9 #include "third_party/skia/include/core/SkRegion.h" |
| 10 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 message_handler_->EndMoveLoop(); | 358 message_handler_->EndMoveLoop(); |
| 359 } | 359 } |
| 360 | 360 |
| 361 void DesktopWindowTreeHostWin::SetVisibilityChangedAnimationsEnabled( | 361 void DesktopWindowTreeHostWin::SetVisibilityChangedAnimationsEnabled( |
| 362 bool value) { | 362 bool value) { |
| 363 message_handler_->SetVisibilityChangedAnimationsEnabled(value); | 363 message_handler_->SetVisibilityChangedAnimationsEnabled(value); |
| 364 content_window_->SetProperty(aura::client::kAnimationsDisabledKey, !value); | 364 content_window_->SetProperty(aura::client::kAnimationsDisabledKey, !value); |
| 365 } | 365 } |
| 366 | 366 |
| 367 bool DesktopWindowTreeHostWin::ShouldUseNativeFrame() const { | 367 bool DesktopWindowTreeHostWin::ShouldUseNativeFrame() const { |
| 368 return ui::win::IsAeroGlassEnabled(); | 368 return IsTranslucentWindowOpacitySupported(); |
| 369 } | 369 } |
| 370 | 370 |
| 371 bool DesktopWindowTreeHostWin::ShouldWindowContentsBeTransparent() const { | 371 bool DesktopWindowTreeHostWin::ShouldWindowContentsBeTransparent() const { |
| 372 // If the window has a native frame, we assume it is an Aero Glass window, and | 372 // If the window has a native frame, we assume it is an Aero Glass window, and |
| 373 // is therefore transparent. Note: This is not equivalent to calling | 373 // is therefore transparent. Note: This is not equivalent to calling |
| 374 // IsAeroGlassEnabled, because ShouldUseNativeFrame is overridden in a | 374 // IsAeroGlassEnabled, because ShouldUseNativeFrame is overridden in a |
| 375 // subclass. | 375 // subclass. |
| 376 return ShouldUseNativeFrame(); | 376 return ShouldUseNativeFrame(); |
| 377 } | 377 } |
| 378 | 378 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 // HWNDMessageHandler will perform the proper updating on its own. | 420 // HWNDMessageHandler will perform the proper updating on its own. |
| 421 } | 421 } |
| 422 | 422 |
| 423 void DesktopWindowTreeHostWin::OnNativeWidgetBlur() { | 423 void DesktopWindowTreeHostWin::OnNativeWidgetBlur() { |
| 424 } | 424 } |
| 425 | 425 |
| 426 bool DesktopWindowTreeHostWin::IsAnimatingClosed() const { | 426 bool DesktopWindowTreeHostWin::IsAnimatingClosed() const { |
| 427 return pending_close_; | 427 return pending_close_; |
| 428 } | 428 } |
| 429 | 429 |
| 430 bool DesktopWindowTreeHostWin::IsTranslucentWindowOpacitySupported() const { |
| 431 return ui::win::IsAeroGlassEnabled(); |
| 432 } |
| 433 |
| 430 //////////////////////////////////////////////////////////////////////////////// | 434 //////////////////////////////////////////////////////////////////////////////// |
| 431 // DesktopWindowTreeHostWin, WindowTreeHost implementation: | 435 // DesktopWindowTreeHostWin, WindowTreeHost implementation: |
| 432 | 436 |
| 433 ui::EventSource* DesktopWindowTreeHostWin::GetEventSource() { | 437 ui::EventSource* DesktopWindowTreeHostWin::GetEventSource() { |
| 434 return this; | 438 return this; |
| 435 } | 439 } |
| 436 | 440 |
| 437 gfx::AcceleratedWidget DesktopWindowTreeHostWin::GetAcceleratedWidget() { | 441 gfx::AcceleratedWidget DesktopWindowTreeHostWin::GetAcceleratedWidget() { |
| 438 return message_handler_->hwnd(); | 442 return message_handler_->hwnd(); |
| 439 } | 443 } |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 | 951 |
| 948 // static | 952 // static |
| 949 DesktopWindowTreeHost* DesktopWindowTreeHost::Create( | 953 DesktopWindowTreeHost* DesktopWindowTreeHost::Create( |
| 950 internal::NativeWidgetDelegate* native_widget_delegate, | 954 internal::NativeWidgetDelegate* native_widget_delegate, |
| 951 DesktopNativeWidgetAura* desktop_native_widget_aura) { | 955 DesktopNativeWidgetAura* desktop_native_widget_aura) { |
| 952 return new DesktopWindowTreeHostWin(native_widget_delegate, | 956 return new DesktopWindowTreeHostWin(native_widget_delegate, |
| 953 desktop_native_widget_aura); | 957 desktop_native_widget_aura); |
| 954 } | 958 } |
| 955 | 959 |
| 956 } // namespace views | 960 } // namespace views |
| OLD | NEW |