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 <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 2417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2428 | 2428 |
2429 aura::Window* root_window = window_->GetRootWindow(); | 2429 aura::Window* root_window = window_->GetRootWindow(); |
2430 if (!root_window) | 2430 if (!root_window) |
2431 return; | 2431 return; |
2432 | 2432 |
2433 display::Screen* screen = display::Screen::GetScreen(); | 2433 display::Screen* screen = display::Screen::GetScreen(); |
2434 DCHECK(screen); | 2434 DCHECK(screen); |
2435 | 2435 |
2436 gfx::Point cursor_screen_point = screen->GetCursorScreenPoint(); | 2436 gfx::Point cursor_screen_point = screen->GetCursorScreenPoint(); |
2437 | 2437 |
2438 #if defined(OS_WIN) | 2438 #if !defined(OS_CHROMEOS) |
2439 // Ignore cursor update messages if the window under the cursor is not us. | 2439 // Ignore cursor update messages if the window under the cursor is not us. |
2440 aura::Window* window_at_screen_point = screen->GetWindowAtScreenPoint( | 2440 aura::Window* window_at_screen_point = screen->GetWindowAtScreenPoint( |
2441 cursor_screen_point); | 2441 cursor_screen_point); |
2442 | 2442 #if defined(OS_WIN) |
2443 // On Windows we may fail to retrieve the aura Window at the current cursor | 2443 // On Windows we may fail to retrieve the aura Window at the current cursor |
2444 // position. This is because the WindowFromPoint API may return the legacy | 2444 // position. This is because the WindowFromPoint API may return the legacy |
2445 // window which is not associated with an aura Window. In this case we need | 2445 // window which is not associated with an aura Window. In this case we need |
2446 // to get the aura window for the parent of the legacy window. | 2446 // to get the aura window for the parent of the legacy window. |
2447 if (!window_at_screen_point && legacy_render_widget_host_HWND_) { | 2447 if (!window_at_screen_point && legacy_render_widget_host_HWND_) { |
2448 HWND hwnd_at_point = ::WindowFromPoint(cursor_screen_point.ToPOINT()); | 2448 HWND hwnd_at_point = ::WindowFromPoint(cursor_screen_point.ToPOINT()); |
2449 | 2449 |
2450 if (hwnd_at_point == legacy_render_widget_host_HWND_->hwnd()) | 2450 if (hwnd_at_point == legacy_render_widget_host_HWND_->hwnd()) |
2451 hwnd_at_point = legacy_render_widget_host_HWND_->GetParent(); | 2451 hwnd_at_point = legacy_render_widget_host_HWND_->GetParent(); |
2452 | 2452 |
2453 display::win::ScreenWin* screen_win = | 2453 display::win::ScreenWin* screen_win = |
2454 static_cast<display::win::ScreenWin*>(screen); | 2454 static_cast<display::win::ScreenWin*>(screen); |
2455 window_at_screen_point = screen_win->GetNativeWindowFromHWND( | 2455 window_at_screen_point = screen_win->GetNativeWindowFromHWND( |
2456 hwnd_at_point); | 2456 hwnd_at_point); |
2457 } | 2457 } |
2458 | 2458 #endif |
2459 if (!window_at_screen_point || | 2459 if (!window_at_screen_point || |
2460 (window_at_screen_point->GetRootWindow() != root_window)) { | 2460 (window_at_screen_point->GetRootWindow() != root_window)) { |
2461 return; | 2461 return; |
2462 } | 2462 } |
2463 #elif !defined(OS_CHROMEOS) | |
2464 if (!screen->IsWindowUnderCursor(window_)) | |
2465 return; | |
2466 #endif | 2463 #endif |
sadrul
2016/05/31 20:25:23
Since you are here: // !defined(OS_CHROMEOS)
| |
2467 | 2464 |
2468 gfx::Point root_window_point = cursor_screen_point; | 2465 gfx::Point root_window_point = cursor_screen_point; |
2469 aura::client::ScreenPositionClient* screen_position_client = | 2466 aura::client::ScreenPositionClient* screen_position_client = |
2470 aura::client::GetScreenPositionClient(root_window); | 2467 aura::client::GetScreenPositionClient(root_window); |
2471 if (screen_position_client) { | 2468 if (screen_position_client) { |
2472 screen_position_client->ConvertPointFromScreen( | 2469 screen_position_client->ConvertPointFromScreen( |
2473 root_window, &root_window_point); | 2470 root_window, &root_window_point); |
2474 } | 2471 } |
2475 | 2472 |
2476 if (root_window->GetEventHandlerForPoint(root_window_point) != window_) | 2473 if (root_window->GetEventHandlerForPoint(root_window_point) != window_) |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2993 | 2990 |
2994 //////////////////////////////////////////////////////////////////////////////// | 2991 //////////////////////////////////////////////////////////////////////////////// |
2995 // RenderWidgetHostViewBase, public: | 2992 // RenderWidgetHostViewBase, public: |
2996 | 2993 |
2997 // static | 2994 // static |
2998 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { | 2995 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { |
2999 GetScreenInfoForWindow(results, NULL); | 2996 GetScreenInfoForWindow(results, NULL); |
3000 } | 2997 } |
3001 | 2998 |
3002 } // namespace content | 2999 } // namespace content |
OLD | NEW |