Chromium Code Reviews| 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 3169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3180 | 3180 |
| 3181 void RenderWidgetHostViewAura::UpdateCursorIfOverSelf() { | 3181 void RenderWidgetHostViewAura::UpdateCursorIfOverSelf() { |
| 3182 const gfx::Point screen_point = | 3182 const gfx::Point screen_point = |
| 3183 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(); | 3183 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(); |
| 3184 aura::RootWindow* root_window = window_->GetRootWindow(); | 3184 aura::RootWindow* root_window = window_->GetRootWindow(); |
| 3185 if (!root_window) | 3185 if (!root_window) |
| 3186 return; | 3186 return; |
| 3187 | 3187 |
| 3188 gfx::Rect screen_rect = GetViewBounds(); | 3188 gfx::Rect screen_rect = GetViewBounds(); |
| 3189 gfx::Point local_point = screen_point; | 3189 gfx::Point local_point = screen_point; |
| 3190 local_point.Offset(-screen_rect.x(), -screen_rect.y()); | 3190 local_point.Offset(-screen_rect.x(), -screen_rect.y()); |
|
sadrul
2013/10/01 14:33:36
I think this is incorrect. This should use ScreenP
tdanderson
2013/10/17 18:23:47
Done.
| |
| 3191 | 3191 |
| 3192 #if defined(OS_WIN) | 3192 #if defined(OS_WIN) |
| 3193 // If there's another toplevel window above us at this point (for example a | 3193 // If there's another toplevel window above us at this point (for example a |
| 3194 // menu), we don't want to update the cursor. | 3194 // menu), we don't want to update the cursor. |
| 3195 POINT windows_point = { screen_point.x(), screen_point.y() }; | 3195 POINT windows_point = { screen_point.x(), screen_point.y() }; |
| 3196 if (root_window->GetAcceleratedWidget() != ::WindowFromPoint(windows_point)) | 3196 if (root_window->GetEventHandlerForPoint(local_point) != window_ || |
| 3197 root_window->GetAcceleratedWidget() != ::WindowFromPoint(windows_point)) | |
| 3198 return; | |
| 3199 #else | |
| 3200 if (root_window->GetEventHandlerForPoint(screen_point) != window_) | |
|
sadrul
2013/10/01 14:33:36
Window::GetEventHandlerForPoint() expects the loca
tdanderson
2013/10/17 18:23:47
Done.
| |
| 3197 return; | 3201 return; |
| 3198 #endif | 3202 #endif |
| 3199 if (root_window->GetEventHandlerForPoint(local_point) != window_) | |
| 3200 return; | |
| 3201 | 3203 |
| 3202 gfx::NativeCursor cursor = current_cursor_.GetNativeCursor(); | 3204 gfx::NativeCursor cursor = current_cursor_.GetNativeCursor(); |
| 3203 // Do not show loading cursor when the cursor is currently hidden. | 3205 // Do not show loading cursor when the cursor is currently hidden. |
| 3204 if (is_loading_ && cursor != ui::kCursorNone) | 3206 if (is_loading_ && cursor != ui::kCursorNone) |
| 3205 cursor = ui::kCursorPointer; | 3207 cursor = ui::kCursorPointer; |
| 3206 | 3208 |
| 3207 aura::client::CursorClient* cursor_client = | 3209 aura::client::CursorClient* cursor_client = |
| 3208 aura::client::GetCursorClient(root_window); | 3210 aura::client::GetCursorClient(root_window); |
| 3209 if (cursor_client) { | 3211 if (cursor_client) { |
| 3210 cursor_client->SetCursor(cursor); | 3212 cursor_client->SetCursor(cursor); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3377 RenderWidgetHost* widget) { | 3379 RenderWidgetHost* widget) { |
| 3378 return new RenderWidgetHostViewAura(widget); | 3380 return new RenderWidgetHostViewAura(widget); |
| 3379 } | 3381 } |
| 3380 | 3382 |
| 3381 // static | 3383 // static |
| 3382 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 3384 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
| 3383 GetScreenInfoForWindow(results, NULL); | 3385 GetScreenInfoForWindow(results, NULL); |
| 3384 } | 3386 } |
| 3385 | 3387 |
| 3386 } // namespace content | 3388 } // namespace content |
| OLD | NEW |