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/browser_plugin/browser_plugin_guest.h" | 5 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 new BrowserPluginMsg_CopyFromCompositingSurface(instance_id(), | 324 new BrowserPluginMsg_CopyFromCompositingSurface(instance_id(), |
325 copy_request_id_, src_subrect, dst_size)); | 325 copy_request_id_, src_subrect, dst_size)); |
326 } | 326 } |
327 | 327 |
328 BrowserPluginGuestManager* | 328 BrowserPluginGuestManager* |
329 BrowserPluginGuest::GetBrowserPluginGuestManager() const { | 329 BrowserPluginGuest::GetBrowserPluginGuestManager() const { |
330 return GetWebContents()->GetBrowserContext()->GetGuestManager(); | 330 return GetWebContents()->GetBrowserContext()->GetGuestManager(); |
331 } | 331 } |
332 | 332 |
333 // screen. | 333 // screen. |
334 gfx::Rect BrowserPluginGuest::ToGuestRect(const gfx::Rect& bounds) { | 334 gfx::Rect BrowserPluginGuest::ToGuestRect(const gfx::Rect& bounds) const { |
335 gfx::Rect guest_rect(bounds); | 335 gfx::Rect guest_rect(bounds); |
336 guest_rect.Offset(guest_window_rect_.OffsetFromOrigin()); | 336 guest_rect.Offset(guest_window_rect_.OffsetFromOrigin()); |
337 return guest_rect; | 337 return guest_rect; |
338 } | 338 } |
339 | 339 |
| 340 gfx::RectF BrowserPluginGuest::ToGuestRect(const gfx::RectF& bounds) const { |
| 341 gfx::RectF guest_rect(bounds); |
| 342 guest_rect.Offset(guest_window_rect_.OffsetFromOrigin()); |
| 343 return guest_rect; |
| 344 } |
| 345 |
340 void BrowserPluginGuest::EmbedderVisibilityChanged(bool visible) { | 346 void BrowserPluginGuest::EmbedderVisibilityChanged(bool visible) { |
341 embedder_visible_ = visible; | 347 embedder_visible_ = visible; |
342 UpdateVisibility(); | 348 UpdateVisibility(); |
343 } | 349 } |
344 | 350 |
345 void BrowserPluginGuest::PointerLockPermissionResponse(bool allow) { | 351 void BrowserPluginGuest::PointerLockPermissionResponse(bool allow) { |
346 SendMessageToEmbedder( | 352 SendMessageToEmbedder( |
347 new BrowserPluginMsg_SetMouseLock(instance_id(), allow)); | 353 new BrowserPluginMsg_SetMouseLock(instance_id(), allow)); |
348 } | 354 } |
349 | 355 |
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
930 void BrowserPluginGuest::OnImeCompositionRangeChanged( | 936 void BrowserPluginGuest::OnImeCompositionRangeChanged( |
931 const gfx::Range& range, | 937 const gfx::Range& range, |
932 const std::vector<gfx::Rect>& character_bounds) { | 938 const std::vector<gfx::Rect>& character_bounds) { |
933 static_cast<RenderWidgetHostViewBase*>( | 939 static_cast<RenderWidgetHostViewBase*>( |
934 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged( | 940 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged( |
935 range, character_bounds); | 941 range, character_bounds); |
936 } | 942 } |
937 #endif | 943 #endif |
938 | 944 |
939 } // namespace content | 945 } // namespace content |
OLD | NEW |