summaryrefslogtreecommitdiffstats
path: root/chrome/plugin
diff options
context:
space:
mode:
authormaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-12 19:49:04 +0000
committermaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-12 19:49:04 +0000
commitb94d3327ed86b1345ceca7806ae1e050055e252b (patch)
treea5fce8db5729299807c8ac0d3bf37e721b535392 /chrome/plugin
parent35b7041fbb49843f868c34ed3b5200d7653a6f5d (diff)
downloadchromium_src-b94d3327ed86b1345ceca7806ae1e050055e252b.zip
chromium_src-b94d3327ed86b1345ceca7806ae1e050055e252b.tar.gz
chromium_src-b94d3327ed86b1345ceca7806ae1e050055e252b.tar.bz2
Lots of small nits to help to split off webkit.dll.
- Stop directly referencing WebPluginDelegateImpl. - Make the password manager to not allocation the data on heap. - Remove some unneeded includes. Review URL: http://codereview.chromium.org/20208 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9692 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/plugin')
-rw-r--r--chrome/plugin/webplugin_delegate_stub.cc4
-rw-r--r--chrome/plugin/webplugin_delegate_stub.h4
-rw-r--r--chrome/plugin/webplugin_proxy.cc33
-rw-r--r--chrome/plugin/webplugin_proxy.h6
4 files changed, 24 insertions, 23 deletions
diff --git a/chrome/plugin/webplugin_delegate_stub.cc b/chrome/plugin/webplugin_delegate_stub.cc
index 31444b6..1a35ecf 100644
--- a/chrome/plugin/webplugin_delegate_stub.cc
+++ b/chrome/plugin/webplugin_delegate_stub.cc
@@ -17,8 +17,8 @@
#include "third_party/npapi/bindings/npapi.h"
#include "third_party/npapi/bindings/npruntime.h"
#include "skia/ext/platform_device.h"
-#include "webkit/glue/plugins/webplugin_delegate_impl.h"
#include "webkit/glue/webcursor.h"
+#include "webkit/glue/webplugin_delegate.h"
class FinishDestructionTask : public Task {
public:
@@ -126,7 +126,7 @@ void WebPluginDelegateStub::OnInit(const PluginMsg_Init_Params& params,
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
FilePath path =
FilePath(command_line.GetSwitchValue(switches::kPluginPath));
- delegate_ = WebPluginDelegateImpl::Create(
+ delegate_ = WebPluginDelegate::Create(
path, mime_type_, params.containing_window);
if (delegate_) {
webplugin_ = new WebPluginProxy(
diff --git a/chrome/plugin/webplugin_delegate_stub.h b/chrome/plugin/webplugin_delegate_stub.h
index d5e8270..9599945 100644
--- a/chrome/plugin/webplugin_delegate_stub.h
+++ b/chrome/plugin/webplugin_delegate_stub.h
@@ -17,7 +17,7 @@
class GURL;
class PluginChannel;
class WebPluginProxy;
-class WebPluginDelegateImpl;
+class WebPluginDelegate;
struct PluginMsg_Init_Params;
struct PluginMsg_DidReceiveResponseParams;
struct PluginMsg_PrintResponse_Params;
@@ -98,7 +98,7 @@ class WebPluginDelegateStub : public IPC::Channel::Listener,
scoped_refptr<PluginChannel> channel_;
- WebPluginDelegateImpl* delegate_;
+ WebPluginDelegate* delegate_;
WebPluginProxy* webplugin_;
DISALLOW_EVIL_CONSTRUCTORS(WebPluginDelegateStub);
diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc
index 7302cbe..448064a 100644
--- a/chrome/plugin/webplugin_proxy.cc
+++ b/chrome/plugin/webplugin_proxy.cc
@@ -18,7 +18,7 @@
#include "chrome/plugin/plugin_thread.h"
#include "chrome/plugin/webplugin_delegate_stub.h"
#include "skia/ext/platform_device.h"
-#include "webkit/glue/plugins/webplugin_delegate_impl.h"
+#include "webkit/glue/webplugin_delegate.h"
typedef std::map<CPBrowsingContext, WebPluginProxy*> ContextMap;
static ContextMap& GetContextMap() {
@@ -28,7 +28,7 @@ static ContextMap& GetContextMap() {
WebPluginProxy::WebPluginProxy(
PluginChannel* channel,
int route_id,
- WebPluginDelegateImpl* delegate,
+ WebPluginDelegate* delegate,
HANDLE modal_dialog_event)
: channel_(channel),
route_id_(route_id),
@@ -109,7 +109,9 @@ void WebPluginProxy::CancelResource(int id) {
}
void WebPluginProxy::Invalidate() {
- gfx::Rect rect(0, 0, delegate_->rect().width(), delegate_->rect().height());
+ gfx::Rect rect(0, 0,
+ delegate_->GetRect().width(),
+ delegate_->GetRect().height());
InvalidateRect(rect);
}
@@ -118,7 +120,7 @@ void WebPluginProxy::InvalidateRect(const gfx::Rect& rect) {
// Ignore NPN_InvalidateRect calls with empty rects. Also don't send an
// invalidate if it's outside the clipping region, since if we did it won't
// lead to a paint and we'll be stuck waiting forever for a DidPaint response.
- if (rect.IsEmpty() || !delegate_->clip_rect().Intersects(rect))
+ if (rect.IsEmpty() || !delegate_->GetClipRect().Intersects(rect))
return;
// Only send a single InvalidateRect message at a time. From DidPaint we
@@ -267,8 +269,8 @@ void WebPluginProxy::HandleURLRequest(const char *method,
if (!target && (0 == _strcmpi(method, "GET"))) {
// Please refer to https://bugzilla.mozilla.org/show_bug.cgi?id=366082
// for more details on this.
- if (delegate_->quirks() &
- WebPluginDelegateImpl::PLUGIN_QUIRK_BLOCK_NONSTANDARD_GETURL_REQUESTS) {
+ if (delegate_->GetQuirks() &
+ WebPluginDelegate::PLUGIN_QUIRK_BLOCK_NONSTANDARD_GETURL_REQUESTS) {
GURL request_url(url);
if (!request_url.SchemeIs("http") && !request_url.SchemeIs("https") &&
!request_url.SchemeIs("ftp")) {
@@ -304,7 +306,7 @@ void WebPluginProxy::Paint(const gfx::Rect& rect) {
// Clear the damaged area so that if the plugin doesn't paint there we won't
// end up with the old values.
gfx::Rect offset_rect = rect;
- offset_rect.Offset(delegate_->rect().x(), delegate_->rect().y());
+ offset_rect.Offset(delegate_->GetRect().origin());
if (!background_hdc_) {
FillRect(windowless_hdc_, &offset_rect.ToRECT(),
static_cast<HBRUSH>(GetStockObject(BLACK_BRUSH)));
@@ -324,11 +326,10 @@ void WebPluginProxy::UpdateGeometry(
const gfx::Rect& clip_rect,
const base::SharedMemoryHandle& windowless_buffer,
const base::SharedMemoryHandle& background_buffer) {
- gfx::Rect old = delegate_->rect();
- gfx::Rect old_clip_rect = delegate_->clip_rect();
+ gfx::Rect old = delegate_->GetRect();
+ gfx::Rect old_clip_rect = delegate_->GetClipRect();
- bool moved = delegate_->rect().x() != window_rect.x() ||
- delegate_->rect().y() != window_rect.y();
+ bool moved = old.x() != window_rect.x() || old.y() != window_rect.y();
delegate_->UpdateGeometry(window_rect, clip_rect);
if (windowless_buffer) {
// The plugin's rect changed, so now we have a new buffer to draw into.
@@ -339,7 +340,7 @@ void WebPluginProxy::UpdateGeometry(
}
// Send over any pending invalidates which occured when the plugin was
// off screen.
- if (delegate_->windowless() && !clip_rect.IsEmpty() &&
+ if (delegate_->IsWindowless() && !clip_rect.IsEmpty() &&
old_clip_rect.IsEmpty() && !damaged_rect_.IsEmpty()) {
InvalidateRect(damaged_rect_);
}
@@ -377,8 +378,8 @@ void WebPluginProxy::ConvertBuffer(const base::SharedMemoryHandle& buffer,
void* data = NULL;
HDC screen_dc = GetDC(NULL);
BITMAPINFOHEADER bitmap_header;
- gfx::CreateBitmapHeader(delegate_->rect().width(),
- delegate_->rect().height(),
+ gfx::CreateBitmapHeader(delegate_->GetRect().width(),
+ delegate_->GetRect().height(),
&bitmap_header);
bitmap->Set(CreateDIBSection(
screen_dc, reinterpret_cast<const BITMAPINFO*>(&bitmap_header),
@@ -404,8 +405,8 @@ void WebPluginProxy::UpdateTransform() {
return;
XFORM xf;
- xf.eDx = static_cast<FLOAT>(-delegate_->rect().x());
- xf.eDy = static_cast<FLOAT>(-delegate_->rect().y());
+ xf.eDx = static_cast<FLOAT>(-delegate_->GetRect().x());
+ xf.eDy = static_cast<FLOAT>(-delegate_->GetRect().y());
xf.eM11 = 1;
xf.eM21 = 0;
xf.eM12 = 0;
diff --git a/chrome/plugin/webplugin_proxy.h b/chrome/plugin/webplugin_proxy.h
index 9f6177b..d6922aa 100644
--- a/chrome/plugin/webplugin_proxy.h
+++ b/chrome/plugin/webplugin_proxy.h
@@ -20,7 +20,7 @@ class WaitableEvent;
}
class PluginChannel;
-class WebPluginDelegateImpl;
+class WebPluginDelegate;
// This is an implementation of WebPlugin that proxies all calls to the
// renderer.
@@ -30,7 +30,7 @@ class WebPluginProxy : public WebPlugin {
// marshalled WebPlugin calls.
WebPluginProxy(PluginChannel* channel,
int route_id,
- WebPluginDelegateImpl* delegate,
+ WebPluginDelegate* delegate,
HANDLE modal_dialog_event);
~WebPluginProxy();
@@ -125,7 +125,7 @@ class WebPluginProxy : public WebPlugin {
int route_id_;
NPObject* window_npobject_;
NPObject* plugin_element_;
- WebPluginDelegateImpl* delegate_;
+ WebPluginDelegate* delegate_;
gfx::Rect damaged_rect_;
bool waiting_for_paint_;
uint32 cp_browsing_context_;