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

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

Issue 2928033002: Move GetDocument method from WebFrame to WebLocalFrame. (Closed)
Patch Set: Split a DCHECK in two as suggested by boliu@. Created 3 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
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 <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bit_cast.h" 10 #include "base/bit_cast.h"
(...skipping 3172 matching lines...) Expand 10 before | Expand all | Expand 10 after
3183 if (fullscreen_container_) { 3183 if (fullscreen_container_) {
3184 fullscreen_container_->PepperDidChangeCursor(*cursor); 3184 fullscreen_container_->PepperDidChangeCursor(*cursor);
3185 } else if (render_frame_) { 3185 } else if (render_frame_) {
3186 render_frame_->PepperDidChangeCursor(this, *cursor); 3186 render_frame_->PepperDidChangeCursor(this, *cursor);
3187 } 3187 }
3188 } 3188 }
3189 3189
3190 bool PepperPluginInstanceImpl::IsFullPagePlugin() { 3190 bool PepperPluginInstanceImpl::IsFullPagePlugin() {
3191 WebLocalFrame* frame = container()->GetDocument().GetFrame(); 3191 WebLocalFrame* frame = container()->GetDocument().GetFrame();
3192 return frame->View()->MainFrame()->IsWebLocalFrame() && 3192 return frame->View()->MainFrame()->IsWebLocalFrame() &&
3193 frame->View()->MainFrame()->GetDocument().IsPluginDocument(); 3193 frame->View()
3194 ->MainFrame()
3195 ->ToWebLocalFrame()
3196 ->GetDocument()
3197 .IsPluginDocument();
3194 } 3198 }
3195 3199
3196 bool PepperPluginInstanceImpl::FlashSetFullscreen(bool fullscreen, 3200 bool PepperPluginInstanceImpl::FlashSetFullscreen(bool fullscreen,
3197 bool delay_report) { 3201 bool delay_report) {
3198 TRACE_EVENT0("ppapi", "PepperPluginInstanceImpl::FlashSetFullscreen"); 3202 TRACE_EVENT0("ppapi", "PepperPluginInstanceImpl::FlashSetFullscreen");
3199 // Keep a reference on the stack. See NOTE above. 3203 // Keep a reference on the stack. See NOTE above.
3200 scoped_refptr<PepperPluginInstanceImpl> ref(this); 3204 scoped_refptr<PepperPluginInstanceImpl> ref(this);
3201 3205
3202 // We check whether we are trying to switch to the state we're already going 3206 // We check whether we are trying to switch to the state we're already going
3203 // to (i.e. if we're already switching to fullscreen but the fullscreen 3207 // to (i.e. if we're already switching to fullscreen but the fullscreen
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
3312 bool PepperPluginInstanceImpl::CanAccessMainFrame() const { 3316 bool PepperPluginInstanceImpl::CanAccessMainFrame() const {
3313 if (!container_) 3317 if (!container_)
3314 return false; 3318 return false;
3315 blink::WebDocument containing_document = container_->GetDocument(); 3319 blink::WebDocument containing_document = container_->GetDocument();
3316 3320
3317 if (!containing_document.GetFrame() || 3321 if (!containing_document.GetFrame() ||
3318 !containing_document.GetFrame()->View() || 3322 !containing_document.GetFrame()->View() ||
3319 !containing_document.GetFrame()->View()->MainFrame()) { 3323 !containing_document.GetFrame()->View()->MainFrame()) {
3320 return false; 3324 return false;
3321 } 3325 }
3322 blink::WebDocument main_document = 3326 blink::WebFrame* main_frame =
3323 containing_document.GetFrame()->View()->MainFrame()->GetDocument(); 3327 containing_document.GetFrame()->View()->MainFrame();
3324 3328
3325 return containing_document.GetSecurityOrigin().CanAccess( 3329 return containing_document.GetSecurityOrigin().CanAccess(
3326 main_document.GetSecurityOrigin()); 3330 main_frame->GetSecurityOrigin());
3327 } 3331 }
3328 3332
3329 void PepperPluginInstanceImpl::KeepSizeAttributesBeforeFullscreen() { 3333 void PepperPluginInstanceImpl::KeepSizeAttributesBeforeFullscreen() {
3330 WebElement element = container_->GetElement(); 3334 WebElement element = container_->GetElement();
3331 width_before_fullscreen_ = element.GetAttribute(WebString::FromUTF8(kWidth)); 3335 width_before_fullscreen_ = element.GetAttribute(WebString::FromUTF8(kWidth));
3332 height_before_fullscreen_ = 3336 height_before_fullscreen_ =
3333 element.GetAttribute(WebString::FromUTF8(kHeight)); 3337 element.GetAttribute(WebString::FromUTF8(kHeight));
3334 border_before_fullscreen_ = 3338 border_before_fullscreen_ =
3335 element.GetAttribute(WebString::FromUTF8(kBorder)); 3339 element.GetAttribute(WebString::FromUTF8(kBorder));
3336 style_before_fullscreen_ = element.GetAttribute(WebString::FromUTF8(kStyle)); 3340 style_before_fullscreen_ = element.GetAttribute(WebString::FromUTF8(kStyle));
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
3499 const cc::TextureMailbox& mailbox) const { 3503 const cc::TextureMailbox& mailbox) const {
3500 auto it = 3504 auto it =
3501 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(), 3505 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(),
3502 [&mailbox](const TextureMailboxRefCount& ref_count) { 3506 [&mailbox](const TextureMailboxRefCount& ref_count) {
3503 return ref_count.first.mailbox() == mailbox.mailbox(); 3507 return ref_count.first.mailbox() == mailbox.mailbox();
3504 }); 3508 });
3505 return it != texture_ref_counts_.end(); 3509 return it != texture_ref_counts_.end();
3506 } 3510 }
3507 3511
3508 } // namespace content 3512 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_file_system_host.cc ('k') | content/renderer/pepper/url_request_info_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698