| 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/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 2958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2969 | 2969 |
| 2970 // If we lose the focus while fullscreen, close the window; Pepper Flash | 2970 // If we lose the focus while fullscreen, close the window; Pepper Flash |
| 2971 // won't do it for us (unlike NPAPI Flash). However, we do not close the | 2971 // won't do it for us (unlike NPAPI Flash). However, we do not close the |
| 2972 // window if we lose the focus to a window on another display. | 2972 // window if we lose the focus to a window on another display. |
| 2973 gfx::Screen* screen = gfx::Screen::GetScreenFor(window_); | 2973 gfx::Screen* screen = gfx::Screen::GetScreenFor(window_); |
| 2974 bool focusing_other_display = | 2974 bool focusing_other_display = |
| 2975 gained_focus && screen->GetNumDisplays() > 1 && | 2975 gained_focus && screen->GetNumDisplays() > 1 && |
| 2976 (screen->GetDisplayNearestWindow(window_).id() != | 2976 (screen->GetDisplayNearestWindow(window_).id() != |
| 2977 screen->GetDisplayNearestWindow(gained_focus).id()); | 2977 screen->GetDisplayNearestWindow(gained_focus).id()); |
| 2978 if (is_fullscreen_ && !in_shutdown_ && !focusing_other_display) { | 2978 if (is_fullscreen_ && !in_shutdown_ && !focusing_other_display) { |
| 2979 #if defined(OS_WIN) |
| 2980 // On Windows, if we are switching to a non Aura Window on a different |
| 2981 // screen we should not close the fullscreen window. |
| 2982 if (!gained_focus) { |
| 2983 POINT point = {0}; |
| 2984 ::GetCursorPos(&point); |
| 2985 if (screen->GetDisplayNearestWindow(window_).id() != |
| 2986 screen->GetDisplayNearestPoint(gfx::Point(point)).id()) |
| 2987 return; |
| 2988 } |
| 2989 #endif |
| 2979 in_shutdown_ = true; | 2990 in_shutdown_ = true; |
| 2980 host_->Shutdown(); | 2991 host_->Shutdown(); |
| 2981 } | 2992 } |
| 2982 } | 2993 } |
| 2983 } | 2994 } |
| 2984 | 2995 |
| 2985 //////////////////////////////////////////////////////////////////////////////// | 2996 //////////////////////////////////////////////////////////////////////////////// |
| 2986 // RenderWidgetHostViewAura, aura::RootWindowObserver implementation: | 2997 // RenderWidgetHostViewAura, aura::RootWindowObserver implementation: |
| 2987 | 2998 |
| 2988 void RenderWidgetHostViewAura::OnRootWindowHostMoved( | 2999 void RenderWidgetHostViewAura::OnRootWindowHostMoved( |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3396 RenderWidgetHost* widget) { | 3407 RenderWidgetHost* widget) { |
| 3397 return new RenderWidgetHostViewAura(widget); | 3408 return new RenderWidgetHostViewAura(widget); |
| 3398 } | 3409 } |
| 3399 | 3410 |
| 3400 // static | 3411 // static |
| 3401 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 3412 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
| 3402 GetScreenInfoForWindow(results, NULL); | 3413 GetScreenInfoForWindow(results, NULL); |
| 3403 } | 3414 } |
| 3404 | 3415 |
| 3405 } // namespace content | 3416 } // namespace content |
| OLD | NEW |