| 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_root_window_host_win.h" | 5 #include "ui/views/widget/desktop_aura/desktop_root_window_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 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 740 native_widget_delegate_->OnNativeWidgetVisibilityChanged(visible); | 740 native_widget_delegate_->OnNativeWidgetVisibilityChanged(visible); |
| 741 } | 741 } |
| 742 | 742 |
| 743 void DesktopRootWindowHostWin::HandleClientSizeChanged( | 743 void DesktopRootWindowHostWin::HandleClientSizeChanged( |
| 744 const gfx::Size& new_size) { | 744 const gfx::Size& new_size) { |
| 745 if (root_window_host_delegate_) | 745 if (root_window_host_delegate_) |
| 746 root_window_host_delegate_->OnHostResized(new_size); | 746 root_window_host_delegate_->OnHostResized(new_size); |
| 747 } | 747 } |
| 748 | 748 |
| 749 void DesktopRootWindowHostWin::HandleFrameChanged() { | 749 void DesktopRootWindowHostWin::HandleFrameChanged() { |
| 750 SetWindowTransparency(); |
| 750 // Replace the frame and layout the contents. | 751 // Replace the frame and layout the contents. |
| 751 GetWidget()->non_client_view()->UpdateFrame(true); | 752 GetWidget()->non_client_view()->UpdateFrame(true); |
| 752 } | 753 } |
| 753 | 754 |
| 754 void DesktopRootWindowHostWin::HandleNativeFocus(HWND last_focused_window) { | 755 void DesktopRootWindowHostWin::HandleNativeFocus(HWND last_focused_window) { |
| 755 // TODO(beng): inform the native_widget_delegate_. | 756 // TODO(beng): inform the native_widget_delegate_. |
| 756 InputMethod* input_method = GetInputMethod(); | 757 InputMethod* input_method = GetInputMethod(); |
| 757 if (input_method) | 758 if (input_method) |
| 758 input_method->OnFocus(); | 759 input_method->OnFocus(); |
| 759 } | 760 } |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 879 } | 880 } |
| 880 | 881 |
| 881 HWND DesktopRootWindowHostWin::GetHWND() const { | 882 HWND DesktopRootWindowHostWin::GetHWND() const { |
| 882 return message_handler_->hwnd(); | 883 return message_handler_->hwnd(); |
| 883 } | 884 } |
| 884 | 885 |
| 885 void DesktopRootWindowHostWin::SetWindowTransparency() { | 886 void DesktopRootWindowHostWin::SetWindowTransparency() { |
| 886 bool transparent = ShouldUseNativeFrame() && !IsFullscreen(); | 887 bool transparent = ShouldUseNativeFrame() && !IsFullscreen(); |
| 887 root_window_->compositor()->SetHostHasTransparentBackground(transparent); | 888 root_window_->compositor()->SetHostHasTransparentBackground(transparent); |
| 888 root_window_->SetTransparent(transparent); | 889 root_window_->SetTransparent(transparent); |
| 890 content_window_->SetTransparent(transparent); |
| 889 } | 891 } |
| 890 | 892 |
| 891 bool DesktopRootWindowHostWin::IsModalWindowActive() const { | 893 bool DesktopRootWindowHostWin::IsModalWindowActive() const { |
| 892 // This function can get called during window creation which occurs before | 894 // This function can get called during window creation which occurs before |
| 893 // root_window_ has been created. | 895 // root_window_ has been created. |
| 894 if (!root_window_) | 896 if (!root_window_) |
| 895 return false; | 897 return false; |
| 896 | 898 |
| 897 aura::Window::Windows::const_iterator index; | 899 aura::Window::Windows::const_iterator index; |
| 898 for (index = root_window_->children().begin(); | 900 for (index = root_window_->children().begin(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 910 | 912 |
| 911 // static | 913 // static |
| 912 DesktopRootWindowHost* DesktopRootWindowHost::Create( | 914 DesktopRootWindowHost* DesktopRootWindowHost::Create( |
| 913 internal::NativeWidgetDelegate* native_widget_delegate, | 915 internal::NativeWidgetDelegate* native_widget_delegate, |
| 914 DesktopNativeWidgetAura* desktop_native_widget_aura) { | 916 DesktopNativeWidgetAura* desktop_native_widget_aura) { |
| 915 return new DesktopRootWindowHostWin(native_widget_delegate, | 917 return new DesktopRootWindowHostWin(native_widget_delegate, |
| 916 desktop_native_widget_aura); | 918 desktop_native_widget_aura); |
| 917 } | 919 } |
| 918 | 920 |
| 919 } // namespace views | 921 } // namespace views |
| OLD | NEW |