Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1545)

Unified Diff: content/browser/web_contents/web_contents_view_aura.cc

Issue 11030017: Add context to gfx::Screen calls in support of simultaneous desktop+ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix new addition Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/web_contents/web_contents_view_aura.cc
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc
index 05dfed09227a7226d214c84a0a4321fe9f528b1e..ac79b2915396e813a9cd20b43ffa83652ee0cfe9 100644
--- a/content/browser/web_contents/web_contents_view_aura.cc
+++ b/content/browser/web_contents/web_contents_view_aura.cc
@@ -266,7 +266,8 @@ void WebContentsViewAura::SizeChangedCommon(const gfx::Size& size) {
void WebContentsViewAura::EndDrag(WebKit::WebDragOperationsMask ops) {
aura::RootWindow* root_window = GetNativeView()->GetRootWindow();
- gfx::Point screen_loc = gfx::Screen::GetCursorScreenPoint();
+ gfx::Point screen_loc =
+ gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint();
gfx::Point client_loc = screen_loc;
content::RenderViewHost* rvh = web_contents_->GetRenderViewHost();
aura::Window* window = rvh->GetView()->GetNativeView();
@@ -462,7 +463,8 @@ void WebContentsViewAura::StartDragging(
// always start from a mouse-event (e.g. a touch or gesture event could
// initiate the drag). The location information should be carried over from
// webkit. http://crbug.com/114754
- gfx::Point location(gfx::Screen::GetCursorScreenPoint());
+ gfx::Point location(
+ gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint());
MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current());
result_op = aura::client::GetDragDropClient(root_window)->StartDragAndDrop(
data, root_window, location, ConvertFromWeb(operations));
@@ -603,7 +605,9 @@ ui::EventResult WebContentsViewAura::OnMouseEvent(ui::MouseEvent* event) {
break;
case ui::ET_MOUSE_MOVED:
web_contents_->GetDelegate()->ContentsMouseEvent(
- web_contents_, gfx::Screen::GetCursorScreenPoint(), true);
+ web_contents_,
+ gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(),
+ true);
break;
default:
break;
@@ -631,7 +635,8 @@ void WebContentsViewAura::OnDragEntered(const ui::DropTargetEvent& event) {
PrepareWebDropData(&drop_data, event.data());
WebKit::WebDragOperationsMask op = ConvertToWeb(event.source_operations());
- gfx::Point screen_pt = gfx::Screen::GetCursorScreenPoint();
+ gfx::Point screen_pt =
+ gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint();
current_rvh_for_drag_ = web_contents_->GetRenderViewHost();
web_contents_->GetRenderViewHost()->DragTargetDragEnter(
drop_data, event.location(), screen_pt, op,
@@ -649,7 +654,8 @@ int WebContentsViewAura::OnDragUpdated(const ui::DropTargetEvent& event) {
OnDragEntered(event);
WebKit::WebDragOperationsMask op = ConvertToWeb(event.source_operations());
- gfx::Point screen_pt = gfx::Screen::GetCursorScreenPoint();
+ gfx::Point screen_pt =
+ gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint();
web_contents_->GetRenderViewHost()->DragTargetDragOver(
event.location(), screen_pt, op,
ConvertAuraEventFlagsToWebInputEventModifiers(event.flags()));
@@ -677,7 +683,7 @@ int WebContentsViewAura::OnPerformDrop(const ui::DropTargetEvent& event) {
web_contents_->GetRenderViewHost()->DragTargetDrop(
event.location(),
- gfx::Screen::GetCursorScreenPoint(),
+ gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(),
ConvertAuraEventFlagsToWebInputEventModifiers(event.flags()));
if (drag_dest_delegate_)
drag_dest_delegate_->OnDrop();
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/browser/web_contents/web_contents_view_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698