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/web_contents/web_contents_view_aura.h" | 5 #include "content/browser/web_contents/web_contents_view_aura.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "content/browser/renderer_host/dip_util.h" | 10 #include "content/browser/renderer_host/dip_util.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 virtual void DidProcessEvent(const base::NativeEvent& event) OVERRIDE { | 179 virtual void DidProcessEvent(const base::NativeEvent& event) OVERRIDE { |
180 if (!contents_) | 180 if (!contents_) |
181 return; | 181 return; |
182 ui::EventType type = ui::EventTypeFromNative(event); | 182 ui::EventType type = ui::EventTypeFromNative(event); |
183 RenderViewHost* rvh = NULL; | 183 RenderViewHost* rvh = NULL; |
184 switch (type) { | 184 switch (type) { |
185 case ui::ET_MOUSE_DRAGGED: | 185 case ui::ET_MOUSE_DRAGGED: |
186 rvh = contents_->GetRenderViewHost(); | 186 rvh = contents_->GetRenderViewHost(); |
187 if (rvh) { | 187 if (rvh) { |
188 gfx::Point screen_loc_in_pixel = ui::EventLocationFromNative(event); | 188 gfx::Point screen_loc_in_pixel = ui::EventLocationFromNative(event); |
189 gfx::Point screen_loc = ConvertPointToDIP(rvh->GetView(), | 189 gfx::Point screen_loc = ConvertViewPointToDIP(rvh->GetView(), |
190 screen_loc_in_pixel); | 190 screen_loc_in_pixel); |
191 gfx::Point client_loc = screen_loc; | 191 gfx::Point client_loc = screen_loc; |
192 aura::Window* window = rvh->GetView()->GetNativeView(); | 192 aura::Window* window = rvh->GetView()->GetNativeView(); |
193 aura::Window::ConvertPointToTarget(window->GetRootWindow(), | 193 aura::Window::ConvertPointToTarget(window->GetRootWindow(), |
194 window, &client_loc); | 194 window, &client_loc); |
195 contents_->DragSourceMovedTo(client_loc.x(), client_loc.y(), | 195 contents_->DragSourceMovedTo(client_loc.x(), client_loc.y(), |
196 screen_loc.x(), screen_loc.y()); | 196 screen_loc.x(), screen_loc.y()); |
197 } | 197 } |
198 break; | 198 break; |
199 default: | 199 default: |
(...skipping 1212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1412 event.location(), | 1412 event.location(), |
1413 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(), | 1413 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(), |
1414 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); | 1414 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); |
1415 if (drag_dest_delegate_) | 1415 if (drag_dest_delegate_) |
1416 drag_dest_delegate_->OnDrop(); | 1416 drag_dest_delegate_->OnDrop(); |
1417 current_drop_data_.reset(); | 1417 current_drop_data_.reset(); |
1418 return current_drag_op_; | 1418 return current_drag_op_; |
1419 } | 1419 } |
1420 | 1420 |
1421 } // namespace content | 1421 } // namespace content |
OLD | NEW |