diff options
author | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-12 19:49:04 +0000 |
---|---|---|
committer | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-12 19:49:04 +0000 |
commit | b94d3327ed86b1345ceca7806ae1e050055e252b (patch) | |
tree | a5fce8db5729299807c8ac0d3bf37e721b535392 /webkit/glue/plugins | |
parent | 35b7041fbb49843f868c34ed3b5200d7653a6f5d (diff) | |
download | chromium_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 'webkit/glue/plugins')
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate_impl.cc | 8 | ||||
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate_impl.h | 34 | ||||
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate_impl_gtk.cc | 2 | ||||
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate_impl_mac.cc | 2 |
4 files changed, 15 insertions, 31 deletions
diff --git a/webkit/glue/plugins/webplugin_delegate_impl.cc b/webkit/glue/plugins/webplugin_delegate_impl.cc index 839cbd5..0ab5c02 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl.cc +++ b/webkit/glue/plugins/webplugin_delegate_impl.cc @@ -58,7 +58,7 @@ base::LazyInstance<iat_patch::IATPatchFunction> g_iat_patch_set_cursor( } // namespace -WebPluginDelegateImpl* WebPluginDelegateImpl::Create( +WebPluginDelegate* WebPluginDelegate::Create( const FilePath& filename, const std::string& mime_type, gfx::NativeView containing_view) { @@ -800,7 +800,7 @@ LRESULT CALLBACK WebPluginDelegateImpl::NativeWndProc( } if (message == delegate->last_message_ && - delegate->quirks() & PLUGIN_QUIRK_DONT_CALL_WND_PROC_RECURSIVELY && + delegate->GetQuirks() & PLUGIN_QUIRK_DONT_CALL_WND_PROC_RECURSIVELY && delegate->is_calling_wndproc) { // Real may go into a state where it recursively dispatches the same event // when subclassed. See https://bugzilla.mozilla.org/show_bug.cgi?id=192914 @@ -852,7 +852,7 @@ LRESULT CALLBACK WebPluginDelegateImpl::NativeWndProc( // usage. See https://bugzilla.mozilla.org/show_bug.cgi?id=132759. We // prevent this by throttling the messages. case WM_USER + 1: { - if (delegate->quirks() & PLUGIN_QUIRK_THROTTLE_WM_USER_PLUS_ONE) { + if (delegate->GetQuirks() & PLUGIN_QUIRK_THROTTLE_WM_USER_PLUS_ONE) { WebPluginDelegateImpl::ThrottleMessage(delegate->plugin_wnd_proc_, hwnd, message, wparam, lparam); g_current_plugin_instance = last_plugin_instance; @@ -1172,7 +1172,7 @@ HCURSOR WINAPI WebPluginDelegateImpl::SetCursorPatch(HCURSOR cursor) { if (!g_current_plugin_instance) return GetCursor(); - if (!g_current_plugin_instance->windowless()) { + if (!g_current_plugin_instance->IsWindowless()) { return SetCursor(cursor); } diff --git a/webkit/glue/plugins/webplugin_delegate_impl.h b/webkit/glue/plugins/webplugin_delegate_impl.h index f196c6e..46d0f95 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl.h +++ b/webkit/glue/plugins/webplugin_delegate_impl.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef WEBKIT_GLUE_PLUGIN_WEBPLUGIN_DELEGATE_IMPL_H__ -#define WEBKIT_GLUE_PLUGIN_WEBPLUGIN_DELEGATE_IMPL_H__ +#ifndef WEBKIT_GLUE_PLUGIN_WEBPLUGIN_DELEGATE_IMPL_H_ +#define WEBKIT_GLUE_PLUGIN_WEBPLUGIN_DELEGATE_IMPL_H_ #include "build/build_config.h" @@ -26,9 +26,6 @@ namespace NPAPI { // the plugin process. class WebPluginDelegateImpl : public WebPluginDelegate { public: - static WebPluginDelegateImpl* Create(const FilePath& filename, - const std::string& mime_type, - gfx::NativeView containing_view); static bool IsPluginDelegateWindow(gfx::NativeWindow window); static bool GetPluginNameFromWindow(gfx::NativeWindow window, std::wstring *plugin_name); @@ -82,24 +79,10 @@ class WebPluginDelegateImpl : public WebPluginDelegate { virtual void URLRequestRouted(const std::string&url, bool notify_needed, void* notify_data); - bool windowless() const { return windowless_ ; } - gfx::Rect rect() const { return window_rect_; } - gfx::Rect clip_rect() const { return clip_rect_; } - -#if defined(OS_WIN) - enum PluginQuirks { - PLUGIN_QUIRK_SETWINDOW_TWICE = 1 << 0, - PLUGIN_QUIRK_THROTTLE_WM_USER_PLUS_ONE = 1 << 1, - PLUGIN_QUIRK_DONT_CALL_WND_PROC_RECURSIVELY = 1 << 2, - PLUGIN_QUIRK_DONT_ALLOW_MULTIPLE_INSTANCES = 1 << 3, - PLUGIN_QUIRK_DIE_AFTER_UNLOAD = 1 << 4, - PLUGIN_QUIRK_PATCH_TRACKPOPUP_MENU = 1 << 5, - PLUGIN_QUIRK_PATCH_SETCURSOR = 1 << 6, - PLUGIN_QUIRK_BLOCK_NONSTANDARD_GETURL_REQUESTS = 1 << 7, - }; -#endif - - int quirks() { return quirks_; } + virtual bool IsWindowless() const { return windowless_ ; } + virtual const gfx::Rect& GetRect() const { return window_rect_; } + virtual const gfx::Rect& GetClipRect() const { return clip_rect_; } + virtual int GetQuirks() const { return quirks_; } private: WebPluginDelegateImpl(gfx::NativeView containing_view, @@ -279,8 +262,9 @@ class WebPluginDelegateImpl : public WebPluginDelegate { // Holds the current cursor set by the windowless plugin. WebCursor current_windowless_cursor_; + friend class WebPluginDelegate; + DISALLOW_EVIL_CONSTRUCTORS(WebPluginDelegateImpl); }; -#endif // #ifndef WEBKIT_GLUE_PLUGIN_WEBPLUGIN_DELEGATE_IMPL_H__ - +#endif // #ifndef WEBKIT_GLUE_PLUGIN_WEBPLUGIN_DELEGATE_IMPL_H_ diff --git a/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc b/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc index 58d853e..40da272b 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc +++ b/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc @@ -37,7 +37,7 @@ #include "webkit/glue/plugins/plugin_stream_url.h" #include "webkit/glue/webkit_glue.h" -WebPluginDelegateImpl* WebPluginDelegateImpl::Create( +WebPluginDelegate* WebPluginDelegate::Create( const FilePath& filename, const std::string& mime_type, gfx::NativeView containing_view) { diff --git a/webkit/glue/plugins/webplugin_delegate_impl_mac.cc b/webkit/glue/plugins/webplugin_delegate_impl_mac.cc index 8c62dbc..1a25ad6c 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl_mac.cc +++ b/webkit/glue/plugins/webplugin_delegate_impl_mac.cc @@ -50,7 +50,7 @@ WebPluginDelegateImpl* g_current_plugin_instance = NULL; } // namespace -WebPluginDelegateImpl* WebPluginDelegateImpl::Create( +WebPluginDelegate* WebPluginDelegate::Create( const FilePath& filename, const std::string& mime_type, gfx::NativeView containing_view) { |