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

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

Issue 2100753003: Enable PDF accessibility when RenderFrame's accessibility mode changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix win assertion Created 4 years, 5 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 2113 matching lines...) Expand 10 before | Expand all | Expand 10 after
2124 bool PepperPluginInstanceImpl::PrepareTextureMailbox( 2124 bool PepperPluginInstanceImpl::PrepareTextureMailbox(
2125 cc::TextureMailbox* mailbox, 2125 cc::TextureMailbox* mailbox,
2126 std::unique_ptr<cc::SingleReleaseCallback>* release_callback, 2126 std::unique_ptr<cc::SingleReleaseCallback>* release_callback,
2127 bool use_shared_memory) { 2127 bool use_shared_memory) {
2128 if (!bound_graphics_2d_platform_) 2128 if (!bound_graphics_2d_platform_)
2129 return false; 2129 return false;
2130 return bound_graphics_2d_platform_->PrepareTextureMailbox(mailbox, 2130 return bound_graphics_2d_platform_->PrepareTextureMailbox(mailbox,
2131 release_callback); 2131 release_callback);
2132 } 2132 }
2133 2133
2134 void PepperPluginInstanceImpl::AccessibilityModeChanged() {
2135 if (render_frame_->render_accessibility() && LoadPdfInterface())
2136 plugin_pdf_interface_->EnableAccessibility(pp_instance());
2137 }
2138
2134 void PepperPluginInstanceImpl::OnDestruct() { render_frame_ = NULL; } 2139 void PepperPluginInstanceImpl::OnDestruct() { render_frame_ = NULL; }
2135 2140
2136 void PepperPluginInstanceImpl::OnThrottleStateChange() { 2141 void PepperPluginInstanceImpl::OnThrottleStateChange() {
2137 SendDidChangeView(); 2142 SendDidChangeView();
2138 2143
2139 bool is_throttled = throttler_->IsThrottled(); 2144 bool is_throttled = throttler_->IsThrottled();
2140 render_frame()->Send(new FrameHostMsg_PluginInstanceThrottleStateChange( 2145 render_frame()->Send(new FrameHostMsg_PluginInstanceThrottleStateChange(
2141 module_->GetPluginChildId(), pp_instance_, is_throttled)); 2146 module_->GetPluginChildId(), pp_instance_, is_throttled));
2142 } 2147 }
2143 2148
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
3000 } 3005 }
3001 3006
3002 return PP_EXTERNAL_PLUGIN_OK; 3007 return PP_EXTERNAL_PLUGIN_OK;
3003 } 3008 }
3004 3009
3005 bool PepperPluginInstanceImpl::IsValidInstanceOf(PluginModule* module) { 3010 bool PepperPluginInstanceImpl::IsValidInstanceOf(PluginModule* module) {
3006 DCHECK(module); 3011 DCHECK(module);
3007 return module == module_.get() || module == original_module_.get(); 3012 return module == module_.get() || module == original_module_.get();
3008 } 3013 }
3009 3014
3015 RenderFrame* PepperPluginInstanceImpl::GetRenderFrame() {
3016 return render_frame_;
3017 }
3018
3010 RenderView* PepperPluginInstanceImpl::GetRenderView() { 3019 RenderView* PepperPluginInstanceImpl::GetRenderView() {
3011 return render_frame_ ? render_frame_->render_view() : NULL; 3020 return render_frame_ ? render_frame_->render_view() : NULL;
3012 } 3021 }
3013 3022
3014 blink::WebPluginContainer* PepperPluginInstanceImpl::GetContainer() { 3023 blink::WebPluginContainer* PepperPluginInstanceImpl::GetContainer() {
3015 return container_; 3024 return container_;
3016 } 3025 }
3017 3026
3018 v8::Isolate* PepperPluginInstanceImpl::GetIsolate() const { return isolate_; } 3027 v8::Isolate* PepperPluginInstanceImpl::GetIsolate() const { return isolate_; }
3019 3028
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
3417 const cc::TextureMailbox& mailbox) const { 3426 const cc::TextureMailbox& mailbox) const {
3418 auto it = 3427 auto it =
3419 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(), 3428 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(),
3420 [&mailbox](const TextureMailboxRefCount& ref_count) { 3429 [&mailbox](const TextureMailboxRefCount& ref_count) {
3421 return ref_count.first.mailbox() == mailbox.mailbox(); 3430 return ref_count.first.mailbox() == mailbox.mailbox();
3422 }); 3431 });
3423 return it != texture_ref_counts_.end(); 3432 return it != texture_ref_counts_.end();
3424 } 3433 }
3425 3434
3426 } // namespace content 3435 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698