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_guest.h" | 5 #include "content/browser/web_contents/web_contents_view_guest.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "content/browser/browser_plugin/browser_plugin_embedder.h" |
8 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 9 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
9 #include "content/browser/renderer_host/render_view_host_factory.h" | 10 #include "content/browser/renderer_host/render_view_host_factory.h" |
10 #include "content/browser/renderer_host/render_view_host_impl.h" | 11 #include "content/browser/renderer_host/render_view_host_impl.h" |
11 #include "content/browser/renderer_host/render_widget_host_view_guest.h" | 12 #include "content/browser/renderer_host/render_widget_host_view_guest.h" |
12 #include "content/browser/web_contents/interstitial_page_impl.h" | 13 #include "content/browser/web_contents/interstitial_page_impl.h" |
13 #include "content/browser/web_contents/web_contents_impl.h" | 14 #include "content/browser/web_contents/web_contents_impl.h" |
| 15 #include "content/common/drag_messages.h" |
14 #include "content/public/browser/web_contents_delegate.h" | 16 #include "content/public/browser/web_contents_delegate.h" |
15 #include "ui/gfx/image/image_skia.h" | 17 #include "ui/gfx/image/image_skia.h" |
16 #include "ui/gfx/point.h" | 18 #include "ui/gfx/point.h" |
17 #include "ui/gfx/rect.h" | 19 #include "ui/gfx/rect.h" |
18 #include "ui/gfx/size.h" | 20 #include "ui/gfx/size.h" |
19 #include "webkit/glue/webdropdata.h" | 21 #include "webkit/glue/webdropdata.h" |
20 | 22 |
21 using WebKit::WebDragOperation; | 23 using WebKit::WebDragOperation; |
22 using WebKit::WebDragOperationsMask; | 24 using WebKit::WebDragOperationsMask; |
23 | 25 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 void WebContentsViewGuest::StoreFocus() { | 154 void WebContentsViewGuest::StoreFocus() { |
153 platform_view_->StoreFocus(); | 155 platform_view_->StoreFocus(); |
154 } | 156 } |
155 | 157 |
156 WebDropData* WebContentsViewGuest::GetDropData() const { | 158 WebDropData* WebContentsViewGuest::GetDropData() const { |
157 NOTIMPLEMENTED(); | 159 NOTIMPLEMENTED(); |
158 return NULL; | 160 return NULL; |
159 } | 161 } |
160 | 162 |
161 void WebContentsViewGuest::UpdateDragCursor(WebDragOperation operation) { | 163 void WebContentsViewGuest::UpdateDragCursor(WebDragOperation operation) { |
162 NOTIMPLEMENTED(); | 164 RenderViewHostImpl* embedder_render_view_host = |
| 165 static_cast<RenderViewHostImpl*>( |
| 166 guest_->embedder_web_contents()->GetRenderViewHost()); |
| 167 CHECK(embedder_render_view_host); |
| 168 RenderViewHostDelegateView* view = |
| 169 embedder_render_view_host->GetDelegate()->GetDelegateView(); |
| 170 if (view) |
| 171 view->UpdateDragCursor(operation); |
163 } | 172 } |
164 | 173 |
165 void WebContentsViewGuest::GotFocus() { | 174 void WebContentsViewGuest::GotFocus() { |
166 } | 175 } |
167 | 176 |
168 void WebContentsViewGuest::TakeFocus(bool reverse) { | 177 void WebContentsViewGuest::TakeFocus(bool reverse) { |
169 } | 178 } |
170 | 179 |
171 void WebContentsViewGuest::ShowContextMenu( | 180 void WebContentsViewGuest::ShowContextMenu( |
172 const ContextMenuParams& params, | 181 const ContextMenuParams& params, |
(...skipping 11 matching lines...) Expand all Loading... |
184 // External popup menus are only used on Mac and Android. | 193 // External popup menus are only used on Mac and Android. |
185 NOTIMPLEMENTED(); | 194 NOTIMPLEMENTED(); |
186 } | 195 } |
187 | 196 |
188 void WebContentsViewGuest::StartDragging( | 197 void WebContentsViewGuest::StartDragging( |
189 const WebDropData& drop_data, | 198 const WebDropData& drop_data, |
190 WebDragOperationsMask ops, | 199 WebDragOperationsMask ops, |
191 const gfx::ImageSkia& image, | 200 const gfx::ImageSkia& image, |
192 const gfx::Vector2d& image_offset, | 201 const gfx::Vector2d& image_offset, |
193 const DragEventSourceInfo& event_info) { | 202 const DragEventSourceInfo& event_info) { |
194 NOTIMPLEMENTED(); | 203 WebContentsImpl* embedder_web_contents = guest_->embedder_web_contents(); |
| 204 embedder_web_contents->GetBrowserPluginEmbedder()->StartDrag(guest_); |
| 205 RenderViewHostImpl* embedder_render_view_host = |
| 206 static_cast<RenderViewHostImpl*>( |
| 207 embedder_web_contents->GetRenderViewHost()); |
| 208 CHECK(embedder_render_view_host); |
| 209 RenderViewHostDelegateView* view = |
| 210 embedder_render_view_host->GetDelegate()->GetDelegateView(); |
| 211 if (view) |
| 212 view->StartDragging(drop_data, ops, image, image_offset, event_info); |
| 213 else |
| 214 embedder_web_contents->SystemDragEnded(); |
195 } | 215 } |
196 | 216 |
197 } // namespace content | 217 } // namespace content |
OLD | NEW |