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 "content/browser/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
987 // webcontents. This will be passed as the container window for windowless | 987 // webcontents. This will be passed as the container window for windowless |
988 // plugins. | 988 // plugins. |
989 // Plugins like Flash assume the container window which is returned via the | 989 // Plugins like Flash assume the container window which is returned via the |
990 // NPNVnetscapeWindow property corresponds to the bounds of the webpage. | 990 // NPNVnetscapeWindow property corresponds to the bounds of the webpage. |
991 // This is not true in Aura where we have only HWND which is the main Aura | 991 // This is not true in Aura where we have only HWND which is the main Aura |
992 // window. If we return this window to plugins like Flash then it causes the | 992 // window. If we return this window to plugins like Flash then it causes the |
993 // coordinate translations done by these plugins to break. | 993 // coordinate translations done by these plugins to break. |
994 // Additonally the legacy dummy window is needed for accessibility and for | 994 // Additonally the legacy dummy window is needed for accessibility and for |
995 // scrolling to work in legacy drivers for trackpoints/trackpads, etc. | 995 // scrolling to work in legacy drivers for trackpoints/trackpads, etc. |
996 if (GetNativeViewId()) { | 996 if (GetNativeViewId()) { |
| 997 bool show_legacy_window = false; |
997 if (!legacy_render_widget_host_HWND_) { | 998 if (!legacy_render_widget_host_HWND_) { |
998 legacy_render_widget_host_HWND_ = LegacyRenderWidgetHostHWND::Create( | 999 legacy_render_widget_host_HWND_ = LegacyRenderWidgetHostHWND::Create( |
999 reinterpret_cast<HWND>(GetNativeViewId())); | 1000 reinterpret_cast<HWND>(GetNativeViewId())); |
| 1001 show_legacy_window = window_->IsVisible(); |
1000 } | 1002 } |
1001 if (legacy_render_widget_host_HWND_) { | 1003 if (legacy_render_widget_host_HWND_) { |
1002 legacy_render_widget_host_HWND_->SetBounds( | 1004 legacy_render_widget_host_HWND_->SetBounds( |
1003 window_->GetBoundsInRootWindow()); | 1005 window_->GetBoundsInRootWindow()); |
| 1006 if (show_legacy_window) |
| 1007 legacy_render_widget_host_HWND_->Show(); |
1004 } | 1008 } |
1005 } | 1009 } |
1006 | 1010 |
1007 if (mouse_locked_) | 1011 if (mouse_locked_) |
1008 UpdateMouseLockRegion(); | 1012 UpdateMouseLockRegion(); |
1009 #endif | 1013 #endif |
1010 } | 1014 } |
1011 | 1015 |
1012 #if defined(OS_WIN) | 1016 #if defined(OS_WIN) |
1013 bool RenderWidgetHostViewAura::UsesNativeWindowFrame() const { | 1017 bool RenderWidgetHostViewAura::UsesNativeWindowFrame() const { |
(...skipping 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2382 | 2386 |
2383 //////////////////////////////////////////////////////////////////////////////// | 2387 //////////////////////////////////////////////////////////////////////////////// |
2384 // RenderWidgetHostViewBase, public: | 2388 // RenderWidgetHostViewBase, public: |
2385 | 2389 |
2386 // static | 2390 // static |
2387 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { | 2391 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { |
2388 GetScreenInfoForWindow(results, NULL); | 2392 GetScreenInfoForWindow(results, NULL); |
2389 } | 2393 } |
2390 | 2394 |
2391 } // namespace content | 2395 } // namespace content |
OLD | NEW |