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/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_guest.h" | 8 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
| 9 #include "content/browser/renderer_host/render_view_host_factory.h" | 9 #include "content/browser/renderer_host/render_view_host_factory.h" |
| 10 #include "content/browser/renderer_host/render_view_host_impl.h" | 10 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 11 #include "content/browser/renderer_host/render_widget_host_view_guest.h" | 11 #include "content/browser/renderer_host/render_widget_host_view_guest.h" |
| 12 #include "content/browser/web_contents/interstitial_page_impl.h" | 12 #include "content/browser/web_contents/interstitial_page_impl.h" |
| 13 #include "content/browser/web_contents/web_contents_impl.h" | 13 #include "content/browser/web_contents/web_contents_impl.h" |
| 14 #include "content/common/drag_messages.h" | |
| 14 #include "content/public/browser/web_contents_delegate.h" | 15 #include "content/public/browser/web_contents_delegate.h" |
| 15 #include "ui/gfx/image/image_skia.h" | 16 #include "ui/gfx/image/image_skia.h" |
| 16 #include "ui/gfx/point.h" | 17 #include "ui/gfx/point.h" |
| 17 #include "ui/gfx/rect.h" | 18 #include "ui/gfx/rect.h" |
| 18 #include "ui/gfx/size.h" | 19 #include "ui/gfx/size.h" |
| 19 #include "webkit/glue/webdropdata.h" | 20 #include "webkit/glue/webdropdata.h" |
| 20 | 21 |
| 21 using WebKit::WebDragOperation; | 22 using WebKit::WebDragOperation; |
| 22 using WebKit::WebDragOperationsMask; | 23 using WebKit::WebDragOperationsMask; |
| 23 | 24 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 148 void WebContentsViewGuest::StoreFocus() { | 149 void WebContentsViewGuest::StoreFocus() { |
| 149 platform_view_->StoreFocus(); | 150 platform_view_->StoreFocus(); |
| 150 } | 151 } |
| 151 | 152 |
| 152 WebDropData* WebContentsViewGuest::GetDropData() const { | 153 WebDropData* WebContentsViewGuest::GetDropData() const { |
| 153 NOTIMPLEMENTED(); | 154 NOTIMPLEMENTED(); |
| 154 return NULL; | 155 return NULL; |
| 155 } | 156 } |
| 156 | 157 |
| 157 void WebContentsViewGuest::UpdateDragCursor(WebDragOperation operation) { | 158 void WebContentsViewGuest::UpdateDragCursor(WebDragOperation operation) { |
| 158 NOTIMPLEMENTED(); | 159 RenderViewHostImpl* embedder_render_view_host = |
| 160 static_cast<RenderViewHostImpl*>( | |
| 161 guest_->embedder_web_contents()->GetRenderViewHost()); | |
| 162 CHECK(embedder_render_view_host); | |
| 163 RenderViewHostDelegateView* view = | |
| 164 embedder_render_view_host->GetDelegate()->GetDelegateView(); | |
| 165 if (view) | |
| 166 view->UpdateDragCursor(operation); | |
| 159 } | 167 } |
| 160 | 168 |
| 161 void WebContentsViewGuest::GotFocus() { | 169 void WebContentsViewGuest::GotFocus() { |
| 162 } | 170 } |
| 163 | 171 |
| 164 void WebContentsViewGuest::TakeFocus(bool reverse) { | 172 void WebContentsViewGuest::TakeFocus(bool reverse) { |
| 165 } | 173 } |
| 166 | 174 |
| 167 void WebContentsViewGuest::ShowContextMenu( | 175 void WebContentsViewGuest::ShowContextMenu( |
| 168 const ContextMenuParams& params, | 176 const ContextMenuParams& params, |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 180 // External popup menus are only used on Mac and Android. | 188 // External popup menus are only used on Mac and Android. |
| 181 NOTIMPLEMENTED(); | 189 NOTIMPLEMENTED(); |
| 182 } | 190 } |
| 183 | 191 |
| 184 void WebContentsViewGuest::StartDragging( | 192 void WebContentsViewGuest::StartDragging( |
| 185 const WebDropData& drop_data, | 193 const WebDropData& drop_data, |
| 186 WebDragOperationsMask ops, | 194 WebDragOperationsMask ops, |
| 187 const gfx::ImageSkia& image, | 195 const gfx::ImageSkia& image, |
| 188 const gfx::Vector2d& image_offset, | 196 const gfx::Vector2d& image_offset, |
| 189 const DragEventSourceInfo& event_info) { | 197 const DragEventSourceInfo& event_info) { |
| 190 NOTIMPLEMENTED(); | 198 RenderViewHostImpl* embedder_render_view_host = |
|
Fady Samuel
2013/04/09 20:49:12
wrong spacing.
mthiesse
2013/04/18 18:02:03
Done.
| |
| 199 static_cast<RenderViewHostImpl*>( | |
| 200 guest_->embedder_web_contents()->GetRenderViewHost()); | |
| 201 CHECK(embedder_render_view_host); | |
| 202 RenderViewHostDelegateView* view = | |
| 203 embedder_render_view_host->GetDelegate()->GetDelegateView(); | |
| 204 if (view) | |
| 205 view->StartDragging(drop_data, ops, image, image_offset, event_info); | |
|
dcheng
2013/04/09 20:59:12
Make sure you call SystemDragEnded() if there's no
mthiesse
2013/04/18 18:02:03
Done.
| |
| 191 } | 206 } |
| 192 | 207 |
| 193 } // namespace content | 208 } // namespace content |
| OLD | NEW |