| 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_embedder.h" |
| 9 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 9 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
| 10 #include "content/browser/renderer_host/render_view_host_factory.h" | 10 #include "content/browser/renderer_host/render_view_host_factory.h" |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 if (view) | 201 if (view) |
| 202 view->UpdateDragCursor(operation); | 202 view->UpdateDragCursor(operation); |
| 203 } | 203 } |
| 204 | 204 |
| 205 void WebContentsViewGuest::GotFocus() { | 205 void WebContentsViewGuest::GotFocus() { |
| 206 } | 206 } |
| 207 | 207 |
| 208 void WebContentsViewGuest::TakeFocus(bool reverse) { | 208 void WebContentsViewGuest::TakeFocus(bool reverse) { |
| 209 } | 209 } |
| 210 | 210 |
| 211 bool WebContentsViewGuest::GrabSnapshot(const std::string& format, |
| 212 int quality, |
| 213 double scale, |
| 214 std::vector<uint8>* data) { |
| 215 return false; |
| 216 } |
| 217 |
| 211 void WebContentsViewGuest::ShowContextMenu(const ContextMenuParams& params) { | 218 void WebContentsViewGuest::ShowContextMenu(const ContextMenuParams& params) { |
| 212 #if defined(USE_AURA) || defined(OS_WIN) | 219 #if defined(USE_AURA) || defined(OS_WIN) |
| 213 // Context menu uses ScreenPositionClient::ConvertPointToScreen() in aura and | 220 // Context menu uses ScreenPositionClient::ConvertPointToScreen() in aura and |
| 214 // windows to calculate popup position. Guest's native view | 221 // windows to calculate popup position. Guest's native view |
| 215 // (platform_view_->GetNativeView()) is part of the embedder's view hierarchy, | 222 // (platform_view_->GetNativeView()) is part of the embedder's view hierarchy, |
| 216 // but is placed at (0, 0) w.r.t. the embedder's position. Therefore, |offset| | 223 // but is placed at (0, 0) w.r.t. the embedder's position. Therefore, |offset| |
| 217 // is added to |params|. | 224 // is added to |params|. |
| 218 gfx::Rect embedder_bounds; | 225 gfx::Rect embedder_bounds; |
| 219 guest_->embedder_web_contents()->GetView()->GetContainerBounds( | 226 guest_->embedder_web_contents()->GetView()->GetContainerBounds( |
| 220 &embedder_bounds); | 227 &embedder_bounds); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 CHECK(embedder_render_view_host); | 263 CHECK(embedder_render_view_host); |
| 257 RenderViewHostDelegateView* view = | 264 RenderViewHostDelegateView* view = |
| 258 embedder_render_view_host->GetDelegate()->GetDelegateView(); | 265 embedder_render_view_host->GetDelegate()->GetDelegateView(); |
| 259 if (view) | 266 if (view) |
| 260 view->StartDragging(drop_data, ops, image, image_offset, event_info); | 267 view->StartDragging(drop_data, ops, image, image_offset, event_info); |
| 261 else | 268 else |
| 262 embedder_web_contents->SystemDragEnded(); | 269 embedder_web_contents->SystemDragEnded(); |
| 263 } | 270 } |
| 264 | 271 |
| 265 } // namespace content | 272 } // namespace content |
| OLD | NEW |