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

Unified Diff: content/renderer/pepper/pepper_plugin_delegate_impl.cc

Issue 19744007: Create a public API around webkit::ppapi::PluginInstance and use it in chrome. After this, webkit/p… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: review comments and undo checkdeps change Created 7 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/pepper/pepper_plugin_delegate_impl.cc
===================================================================
--- content/renderer/pepper/pepper_plugin_delegate_impl.cc (revision 213462)
+++ content/renderer/pepper/pepper_plugin_delegate_impl.cc (working copy)
@@ -96,7 +96,7 @@
#include "ui/gfx/size.h"
#include "url/gurl.h"
#include "webkit/plugins/ppapi/plugin_module.h"
-#include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
+#include "webkit/plugins/ppapi/ppapi_plugin_instance_impl.h"
#include "webkit/plugins/ppapi/ppapi_webplugin_impl.h"
#include "webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.h"
#include "webkit/plugins/ppapi/ppb_tcp_socket_private_impl.h"
@@ -182,8 +182,8 @@
PepperRendererInstanceData(
0, // The render process id will be supplied in the browser.
render_view->GetRoutingID(),
- plugin_instance->container()->element().document().url(),
- plugin_instance->plugin_url()),
+ plugin_instance->GetContainer()->element().document().url(),
+ plugin_instance->GetPluginURL()),
is_external_));
}
}
@@ -247,7 +247,7 @@
class PluginInstanceLockTarget : public MouseLockDispatcher::LockTarget {
public:
- PluginInstanceLockTarget(webkit::ppapi::PluginInstance* plugin)
+ PluginInstanceLockTarget(webkit::ppapi::PluginInstanceImpl* plugin)
: plugin_(plugin) {}
virtual void OnLockMouseACK(bool succeeded) OVERRIDE {
@@ -265,7 +265,7 @@
}
private:
- webkit::ppapi::PluginInstance* plugin_;
+ webkit::ppapi::PluginInstanceImpl* plugin_;
};
void DoNotifyCloseFile(int file_open_id, base::PlatformFileError /* unused */) {
@@ -530,7 +530,7 @@
// Notify all of our instances that we started painting. This is used for
// internal bookkeeping only, so we know that the set can not change under
// us.
- for (std::set<webkit::ppapi::PluginInstance*>::iterator i =
+ for (std::set<webkit::ppapi::PluginInstanceImpl*>::iterator i =
active_instances_.begin();
i != active_instances_.end(); ++i)
(*i)->ViewWillInitiatePaint();
@@ -540,8 +540,9 @@
// Notify all instances that we painted. The same caveats apply as for
// ViewFlushedPaint regarding instances closing themselves, so we take
// similar precautions.
- std::set<webkit::ppapi::PluginInstance*> plugins = active_instances_;
- for (std::set<webkit::ppapi::PluginInstance*>::iterator i = plugins.begin();
+ std::set<webkit::ppapi::PluginInstanceImpl*> plugins = active_instances_;
+ for (std::set<webkit::ppapi::PluginInstanceImpl*>::iterator i =
+ plugins.begin();
i != plugins.end(); ++i) {
if (active_instances_.find(*i) != active_instances_.end())
(*i)->ViewInitiatedPaint();
@@ -553,8 +554,9 @@
// we it may ask to close itself as a result. This will, in turn, modify our
// set, possibly invalidating the iterator. So we iterate on a copy that
// won't change out from under us.
- std::set<webkit::ppapi::PluginInstance*> plugins = active_instances_;
- for (std::set<webkit::ppapi::PluginInstance*>::iterator i = plugins.begin();
+ std::set<webkit::ppapi::PluginInstanceImpl*> plugins = active_instances_;
+ for (std::set<webkit::ppapi::PluginInstanceImpl*>::iterator i =
+ plugins.begin();
i != plugins.end(); ++i) {
// The copy above makes sure our iterator is never invalid if some plugins
// are destroyed. But some plugin may decide to close all of its views in
@@ -577,17 +579,17 @@
}
}
-webkit::ppapi::PluginInstance*
+webkit::ppapi::PluginInstanceImpl*
PepperPluginDelegateImpl::GetBitmapForOptimizedPluginPaint(
const gfx::Rect& paint_bounds,
TransportDIB** dib,
gfx::Rect* location,
gfx::Rect* clip,
float* scale_factor) {
- for (std::set<webkit::ppapi::PluginInstance*>::iterator i =
+ for (std::set<webkit::ppapi::PluginInstanceImpl*>::iterator i =
active_instances_.begin();
i != active_instances_.end(); ++i) {
- webkit::ppapi::PluginInstance* instance = *i;
+ webkit::ppapi::PluginInstanceImpl* instance = *i;
// In Flash fullscreen , the plugin contents should be painted onto the
// fullscreen widget instead of the web page.
if (!instance->FlashIsFullscreenOrPending() &&
@@ -599,7 +601,7 @@
}
void PepperPluginDelegateImpl::PluginFocusChanged(
- webkit::ppapi::PluginInstance* instance,
+ webkit::ppapi::PluginInstanceImpl* instance,
bool focused) {
if (focused)
focused_plugin_ = instance;
@@ -610,25 +612,25 @@
}
void PepperPluginDelegateImpl::PluginTextInputTypeChanged(
- webkit::ppapi::PluginInstance* instance) {
+ webkit::ppapi::PluginInstanceImpl* instance) {
if (focused_plugin_ == instance && render_view_)
render_view_->PpapiPluginTextInputTypeChanged();
}
void PepperPluginDelegateImpl::PluginCaretPositionChanged(
- webkit::ppapi::PluginInstance* instance) {
+ webkit::ppapi::PluginInstanceImpl* instance) {
if (focused_plugin_ == instance && render_view_)
render_view_->PpapiPluginCaretPositionChanged();
}
void PepperPluginDelegateImpl::PluginRequestedCancelComposition(
- webkit::ppapi::PluginInstance* instance) {
+ webkit::ppapi::PluginInstanceImpl* instance) {
if (focused_plugin_ == instance && render_view_)
render_view_->PpapiPluginCancelComposition();
}
void PepperPluginDelegateImpl::PluginSelectionChanged(
- webkit::ppapi::PluginInstance* instance) {
+ webkit::ppapi::PluginInstanceImpl* instance) {
if (focused_plugin_ == instance && render_view_)
render_view_->PpapiPluginSelectionChanged();
}
@@ -739,14 +741,14 @@
}
void PepperPluginDelegateImpl::PluginCrashed(
- webkit::ppapi::PluginInstance* instance) {
+ webkit::ppapi::PluginInstanceImpl* instance) {
render_view_->PluginCrashed(instance->module()->path(),
instance->module()->GetPeerProcessId());
UnSetAndDeleteLockTargetAdapter(instance);
}
void PepperPluginDelegateImpl::InstanceCreated(
- webkit::ppapi::PluginInstance* instance) {
+ webkit::ppapi::PluginInstanceImpl* instance) {
active_instances_.insert(instance);
// Set the initial focus.
@@ -754,7 +756,7 @@
}
void PepperPluginDelegateImpl::InstanceDeleted(
- webkit::ppapi::PluginInstance* instance) {
+ webkit::ppapi::PluginInstanceImpl* instance) {
active_instances_.erase(instance);
UnSetAndDeleteLockTargetAdapter(instance);
@@ -766,7 +768,7 @@
scoped_ptr< ::ppapi::thunk::ResourceCreationAPI>
PepperPluginDelegateImpl::CreateResourceCreationAPI(
- webkit::ppapi::PluginInstance* instance) {
+ webkit::ppapi::PluginInstanceImpl* instance) {
RendererPpapiHostImpl* host_impl = static_cast<RendererPpapiHostImpl*>(
instance->module()->GetEmbedderState());
return host_impl->CreateInProcessResourceCreationAPI(instance);
@@ -789,7 +791,7 @@
webkit::ppapi::PluginDelegate::PlatformGraphics2D*
PepperPluginDelegateImpl::GetGraphics2D(
- webkit::ppapi::PluginInstance* instance,
+ webkit::ppapi::PluginInstanceImpl* instance,
PP_Resource resource) {
ppapi::host::ResourceHost* host =
GetRendererResourceHost(instance->pp_instance(), resource);
@@ -958,14 +960,14 @@
}
void PepperPluginDelegateImpl::OnSetFocus(bool has_focus) {
- for (std::set<webkit::ppapi::PluginInstance*>::iterator i =
+ for (std::set<webkit::ppapi::PluginInstanceImpl*>::iterator i =
active_instances_.begin();
i != active_instances_.end(); ++i)
(*i)->SetContentAreaFocus(has_focus);
}
void PepperPluginDelegateImpl::PageVisibilityChanged(bool is_visible) {
- for (std::set<webkit::ppapi::PluginInstance*>::iterator i =
+ for (std::set<webkit::ppapi::PluginInstanceImpl*>::iterator i =
active_instances_.begin();
i != active_instances_.end(); ++i)
(*i)->PageVisibilityChanged(is_visible);
@@ -1266,7 +1268,7 @@
webkit::ppapi::FullscreenContainer*
PepperPluginDelegateImpl::CreateFullscreenContainer(
- webkit::ppapi::PluginInstance* instance) {
+ webkit::ppapi::PluginInstanceImpl* instance) {
return render_view_->CreatePepperFullscreenContainer(instance);
}
@@ -1287,7 +1289,7 @@
}
void PepperPluginDelegateImpl::HandleDocumentLoad(
- webkit::ppapi::PluginInstance* instance,
+ webkit::ppapi::PluginInstanceImpl* instance,
const WebKit::WebURLResponse& response) {
DCHECK(!instance->document_loader());
@@ -1372,25 +1374,25 @@
}
bool PepperPluginDelegateImpl::LockMouse(
- webkit::ppapi::PluginInstance* instance) {
+ webkit::ppapi::PluginInstanceImpl* instance) {
return GetMouseLockDispatcher(instance)->LockMouse(
GetOrCreateLockTargetAdapter(instance));
}
void PepperPluginDelegateImpl::UnlockMouse(
- webkit::ppapi::PluginInstance* instance) {
+ webkit::ppapi::PluginInstanceImpl* instance) {
GetMouseLockDispatcher(instance)->UnlockMouse(
GetOrCreateLockTargetAdapter(instance));
}
bool PepperPluginDelegateImpl::IsMouseLocked(
- webkit::ppapi::PluginInstance* instance) {
+ webkit::ppapi::PluginInstanceImpl* instance) {
return GetMouseLockDispatcher(instance)->IsMouseLockedTo(
GetOrCreateLockTargetAdapter(instance));
}
void PepperPluginDelegateImpl::DidChangeCursor(
- webkit::ppapi::PluginInstance* instance,
+ webkit::ppapi::PluginInstanceImpl* instance,
const WebKit::WebCursorInfo& cursor) {
// Update the cursor appearance immediately if the requesting plugin is the
// one which receives the last mouse event. Otherwise, the new cursor won't be
@@ -1402,7 +1404,7 @@
}
void PepperPluginDelegateImpl::DidReceiveMouseEvent(
- webkit::ppapi::PluginInstance* instance) {
+ webkit::ppapi::PluginInstanceImpl* instance) {
last_mouse_event_target_ = instance;
}
@@ -1648,7 +1650,7 @@
MouseLockDispatcher::LockTarget*
PepperPluginDelegateImpl::GetOrCreateLockTargetAdapter(
- webkit::ppapi::PluginInstance* instance) {
+ webkit::ppapi::PluginInstanceImpl* instance) {
MouseLockDispatcher::LockTarget* target = mouse_lock_instances_[instance];
if (target)
return target;
@@ -1658,7 +1660,7 @@
}
void PepperPluginDelegateImpl::UnSetAndDeleteLockTargetAdapter(
- webkit::ppapi::PluginInstance* instance) {
+ webkit::ppapi::PluginInstanceImpl* instance) {
LockTargetMap::iterator it = mouse_lock_instances_.find(instance);
if (it != mouse_lock_instances_.end()) {
MouseLockDispatcher::LockTarget* target = it->second;
@@ -1669,7 +1671,7 @@
}
MouseLockDispatcher* PepperPluginDelegateImpl::GetMouseLockDispatcher(
- webkit::ppapi::PluginInstance* instance) {
+ webkit::ppapi::PluginInstanceImpl* instance) {
if (instance->flash_fullscreen()) {
RenderWidgetFullscreenPepper* container =
static_cast<RenderWidgetFullscreenPepper*>(
« no previous file with comments | « content/renderer/pepper/pepper_plugin_delegate_impl.h ('k') | content/renderer/pepper/pepper_url_loader_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698