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/renderer/pepper/pepper_plugin_instance_impl.h" | 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1197 new_clip = clip; | 1197 new_clip = clip; |
1198 | 1198 |
1199 cut_outs_rects_ = cut_outs_rects; | 1199 cut_outs_rects_ = cut_outs_rects; |
1200 | 1200 |
1201 view_data_.rect = PP_FromGfxRect(position); | 1201 view_data_.rect = PP_FromGfxRect(position); |
1202 view_data_.clip_rect = PP_FromGfxRect(clip); | 1202 view_data_.clip_rect = PP_FromGfxRect(clip); |
1203 view_data_.device_scale = container_->deviceScaleFactor(); | 1203 view_data_.device_scale = container_->deviceScaleFactor(); |
1204 view_data_.css_scale = | 1204 view_data_.css_scale = |
1205 container_->pageZoomFactor() * container_->pageScaleFactor(); | 1205 container_->pageZoomFactor() * container_->pageScaleFactor(); |
1206 | 1206 |
| 1207 gfx::Size scroll_offset = |
| 1208 container_->element().document().frame()->scrollOffset(); |
| 1209 view_data_.scroll_offset = PP_MakePoint(scroll_offset.width(), |
| 1210 scroll_offset.height()); |
| 1211 |
1207 if (desired_fullscreen_state_ || view_data_.is_fullscreen) { | 1212 if (desired_fullscreen_state_ || view_data_.is_fullscreen) { |
1208 WebElement element = container_->element(); | 1213 WebElement element = container_->element(); |
1209 WebDocument document = element.document(); | 1214 WebDocument document = element.document(); |
1210 bool is_fullscreen_element = (element == document.fullScreenElement()); | 1215 bool is_fullscreen_element = (element == document.fullScreenElement()); |
1211 if (!view_data_.is_fullscreen && desired_fullscreen_state_ && | 1216 if (!view_data_.is_fullscreen && desired_fullscreen_state_ && |
1212 render_frame()->GetRenderWidget()->is_fullscreen() && | 1217 render_frame()->GetRenderWidget()->is_fullscreen() && |
1213 is_fullscreen_element) { | 1218 is_fullscreen_element) { |
1214 // Entered fullscreen. Only possible via SetFullscreen(). | 1219 // Entered fullscreen. Only possible via SetFullscreen(). |
1215 view_data_.is_fullscreen = true; | 1220 view_data_.is_fullscreen = true; |
1216 } else if (view_data_.is_fullscreen && !is_fullscreen_element) { | 1221 } else if (view_data_.is_fullscreen && !is_fullscreen_element) { |
(...skipping 2016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3233 // Running out-of-process. Initiate an IPC call to notify the plugin | 3238 // Running out-of-process. Initiate an IPC call to notify the plugin |
3234 // process. | 3239 // process. |
3235 ppapi::proxy::HostDispatcher* dispatcher = | 3240 ppapi::proxy::HostDispatcher* dispatcher = |
3236 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); | 3241 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); |
3237 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( | 3242 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( |
3238 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); | 3243 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); |
3239 } | 3244 } |
3240 } | 3245 } |
3241 | 3246 |
3242 } // namespace content | 3247 } // namespace content |
OLD | NEW |