Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(497)

Side by Side Diff: content/renderer/pepper/pepper_plugin_instance_impl.cc

Issue 329033003: Add GetScrollOffset function to PPB_View (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 // Only set the scroll offset if the plugin is visible.
dmichael (off chromium) 2014/06/16 22:31:56 Why have this restriction?
raymes 2014/06/17 00:43:00 Originally I had this because I thought we might e
1208 if (!view_data_.is_page_visible ||
1209 view_data_.clip_rect.size.width == 0 ||
1210 view_data_.clip_rect.size.height == 0) {
1211 view_data_.scroll_offset = PP_MakePoint(0, 0);
1212 } else {
1213 gfx::Size scroll_offset =
1214 container_->element().document().frame()->scrollOffset();
1215 view_data_.scroll_offset = PP_MakePoint(scroll_offset.width(),
1216 scroll_offset.height());
1217 }
1218
1207 if (desired_fullscreen_state_ || view_data_.is_fullscreen) { 1219 if (desired_fullscreen_state_ || view_data_.is_fullscreen) {
1208 WebElement element = container_->element(); 1220 WebElement element = container_->element();
1209 WebDocument document = element.document(); 1221 WebDocument document = element.document();
1210 bool is_fullscreen_element = (element == document.fullScreenElement()); 1222 bool is_fullscreen_element = (element == document.fullScreenElement());
1211 if (!view_data_.is_fullscreen && desired_fullscreen_state_ && 1223 if (!view_data_.is_fullscreen && desired_fullscreen_state_ &&
1212 render_frame()->GetRenderWidget()->is_fullscreen() && 1224 render_frame()->GetRenderWidget()->is_fullscreen() &&
1213 is_fullscreen_element) { 1225 is_fullscreen_element) {
1214 // Entered fullscreen. Only possible via SetFullscreen(). 1226 // Entered fullscreen. Only possible via SetFullscreen().
1215 view_data_.is_fullscreen = true; 1227 view_data_.is_fullscreen = true;
1216 } else if (view_data_.is_fullscreen && !is_fullscreen_element) { 1228 } else if (view_data_.is_fullscreen && !is_fullscreen_element) {
(...skipping 2016 matching lines...) Expand 10 before | Expand all | Expand 10 after
3233 // Running out-of-process. Initiate an IPC call to notify the plugin 3245 // Running out-of-process. Initiate an IPC call to notify the plugin
3234 // process. 3246 // process.
3235 ppapi::proxy::HostDispatcher* dispatcher = 3247 ppapi::proxy::HostDispatcher* dispatcher =
3236 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); 3248 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance());
3237 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( 3249 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad(
3238 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); 3250 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data));
3239 } 3251 }
3240 } 3252 }
3241 3253
3242 } // namespace content 3254 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698