| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #if defined(OS_WIN) | 5 #if defined(OS_WIN) |
| 6 #include <atlbase.h> | 6 #include <atlbase.h> |
| 7 #include <atlapp.h> | 7 #include <atlapp.h> |
| 8 #include <atlmisc.h> | 8 #include <atlmisc.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 } // namespace | 31 } // namespace |
| 32 /////////////////////////////////////////////////////////////////////////////// | 32 /////////////////////////////////////////////////////////////////////////////// |
| 33 // WebDragSource, public: | 33 // WebDragSource, public: |
| 34 | 34 |
| 35 WebDragSource::WebDragSource(gfx::NativeWindow source_wnd, | 35 WebDragSource::WebDragSource(gfx::NativeWindow source_wnd, |
| 36 RenderViewHost* render_view_host) | 36 RenderViewHost* render_view_host) |
| 37 : BaseDragSource(), | 37 : BaseDragSource(), |
| 38 source_wnd_(source_wnd), | 38 source_wnd_(source_wnd), |
| 39 render_view_host_(render_view_host) { | 39 render_view_host_(render_view_host) { |
| 40 // In an effort to try to track down http://crbug.com/12524 we now CHECK | |
| 41 // when a NULL render_view_host is passed to us. I think this is what is | |
| 42 // happening but it is hard to tell since the minidump is not helpful in this | |
| 43 // case. At least we can then rule that out. | |
| 44 CHECK(render_view_host_); | |
| 45 } | 40 } |
| 46 | 41 |
| 47 void WebDragSource::OnDragSourceCancel() { | 42 void WebDragSource::OnDragSourceCancel() { |
| 48 gfx::Point client; | 43 gfx::Point client; |
| 49 gfx::Point screen; | 44 gfx::Point screen; |
| 50 GetCursorPositions(source_wnd_, &client, &screen); | 45 GetCursorPositions(source_wnd_, &client, &screen); |
| 51 render_view_host_->DragSourceCancelledAt(client.x(), client.y(), | 46 render_view_host_->DragSourceCancelledAt(client.x(), client.y(), |
| 52 screen.x(), screen.y()); | 47 screen.x(), screen.y()); |
| 53 } | 48 } |
| 54 | 49 |
| 55 void WebDragSource::OnDragSourceDrop() { | 50 void WebDragSource::OnDragSourceDrop() { |
| 56 gfx::Point client; | 51 gfx::Point client; |
| 57 gfx::Point screen; | 52 gfx::Point screen; |
| 58 GetCursorPositions(source_wnd_, &client, &screen); | 53 GetCursorPositions(source_wnd_, &client, &screen); |
| 59 render_view_host_->DragSourceEndedAt(client.x(), client.y(), | 54 render_view_host_->DragSourceEndedAt(client.x(), client.y(), |
| 60 screen.x(), screen.y()); | 55 screen.x(), screen.y()); |
| 61 } | 56 } |
| 62 | 57 |
| 63 void WebDragSource::OnDragSourceMove() { | 58 void WebDragSource::OnDragSourceMove() { |
| 64 gfx::Point client; | 59 gfx::Point client; |
| 65 gfx::Point screen; | 60 gfx::Point screen; |
| 66 GetCursorPositions(source_wnd_, &client, &screen); | 61 GetCursorPositions(source_wnd_, &client, &screen); |
| 67 render_view_host_->DragSourceMovedTo(client.x(), client.y(), | 62 render_view_host_->DragSourceMovedTo(client.x(), client.y(), |
| 68 screen.x(), screen.y()); | 63 screen.x(), screen.y()); |
| 69 } | 64 } |
| OLD | NEW |