diff options
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/default_plugin/default_plugin.gyp | 1 | ||||
-rw-r--r-- | webkit/default_plugin/plugin_impl_win.cc | 75 | ||||
-rw-r--r-- | webkit/default_plugin/plugin_impl_win.h | 10 | ||||
-rw-r--r-- | webkit/tools/test_shell/foreground_helper.h | 12 | ||||
-rw-r--r-- | webkit/webkit.gyp | 3 |
5 files changed, 48 insertions, 53 deletions
diff --git a/webkit/default_plugin/default_plugin.gyp b/webkit/default_plugin/default_plugin.gyp index 375431a..2aeac4e 100644 --- a/webkit/default_plugin/default_plugin.gyp +++ b/webkit/default_plugin/default_plugin.gyp @@ -26,7 +26,6 @@ ], 'include_dirs': [ '../..', - '../../chrome/third_party/wtl/include', # TODO(bradnelson): this should fall out of the dependencies. '<(SHARED_INTERMEDIATE_DIR)/webkit', ], diff --git a/webkit/default_plugin/plugin_impl_win.cc b/webkit/default_plugin/plugin_impl_win.cc index 904aa7f..a940927 100644 --- a/webkit/default_plugin/plugin_impl_win.cc +++ b/webkit/default_plugin/plugin_impl_win.cc @@ -44,10 +44,10 @@ PluginInstallerImpl::~PluginInstallerImpl() { installation_job_monitor_thread_->Stop(); if (bold_font_) - DeleteObject(bold_font_); + ::DeleteObject(bold_font_); if (underline_font_) - DeleteObject(underline_font_); + ::DeleteObject(underline_font_); if (activex_installer_) { activex_installer_->Cleanup(); @@ -55,7 +55,7 @@ PluginInstallerImpl::~PluginInstallerImpl() { } if (tooltip_) - DestroyWindow(tooltip_); + ::DestroyWindow(tooltip_); } bool PluginInstallerImpl::Initialize(HINSTANCE module_handle, NPP instance, @@ -118,8 +118,8 @@ void PluginInstallerImpl::Shutdown() { if (install_dialog_.IsWindow()) { install_dialog_.DestroyWindow(); } - if (IsWindow(hwnd())) { - DestroyWindow(hwnd()); + if (IsWindow()) { + DestroyWindow(); } } @@ -168,12 +168,12 @@ void PluginInstallerImpl::ClearDisplay() { } void PluginInstallerImpl::RefreshDisplay() { - if (!IsWindow(hwnd())) + if (!IsWindow()) return; UpdateToolTip(); - InvalidateRect(hwnd(), NULL, TRUE); - UpdateWindow(hwnd()); + InvalidateRect(NULL, TRUE); + UpdateWindow(); } bool PluginInstallerImpl::CreateToolTip() { @@ -182,16 +182,16 @@ bool PluginInstallerImpl::CreateToolTip() { WS_POPUP | TTS_ALWAYSTIP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - hwnd(), NULL, NULL, NULL); + m_hWnd, NULL, NULL, NULL); if (!tooltip_) return false; // Associate the ToolTip with the tool. TOOLINFO tool_info = {0}; tool_info.cbSize = sizeof(tool_info); - tool_info.hwnd = hwnd(); + tool_info.hwnd = m_hWnd; tool_info.uFlags = TTF_IDISHWND | TTF_SUBCLASS; - tool_info.uId = reinterpret_cast<UINT_PTR>(hwnd()); + tool_info.uId = reinterpret_cast<UINT_PTR>(m_hWnd); tool_info.lpszText = NULL; SendMessage(tooltip_, TTM_ADDTOOL, 0, reinterpret_cast<LPARAM>(&tool_info)); SendMessage(tooltip_, TTM_SETMAXTIPWIDTH, 0, TOOLTIP_MAX_WIDTH); @@ -207,9 +207,9 @@ void PluginInstallerImpl::UpdateToolTip() { TOOLINFO tool_info = {0}; tool_info.cbSize = sizeof(tool_info); - tool_info.hwnd = hwnd(); + tool_info.hwnd = m_hWnd; tool_info.uFlags = TTF_IDISHWND; - tool_info.uId = reinterpret_cast<UINT_PTR>(hwnd()); + tool_info.uId = reinterpret_cast<UINT_PTR>(m_hWnd); tool_info.lpszText = const_cast<LPWSTR>(tip.c_str()); SendMessage(tooltip_, TTM_UPDATETIPTEXT, 0, (LPARAM)&tool_info); } @@ -316,9 +316,9 @@ std::wstring PluginInstallerImpl::ReplaceStringForPossibleEmptyReplacement( } bool PluginInstallerImpl::SetWindow(HWND parent_window) { - if (!IsWindow(parent_window)) { + if (!::IsWindow(parent_window)) { // No window created yet. Ignore this call. - if (!IsWindow(hwnd())) + if (!IsWindow()) return true; // Parent window has been destroyed. Shutdown(); @@ -327,25 +327,22 @@ bool PluginInstallerImpl::SetWindow(HWND parent_window) { RECT parent_rect = {0}; - if (IsWindow(hwnd())) { - GetClientRect(parent_window, &parent_rect); - SetWindowPos(hwnd(), NULL, parent_rect.left, parent_rect.top, - parent_rect.right - parent_rect.left, - parent_rect.bottom - parent_rect.top, SWP_SHOWWINDOW); + if (IsWindow()) { + ::GetClientRect(parent_window, &parent_rect); + SetWindowPos(NULL, &parent_rect, SWP_SHOWWINDOW); return true; } // First time in -- no window created by plugin yet. - GetClientRect(parent_window, &parent_rect); - set_window_style(WS_CHILD | WS_BORDER); - Init(parent_window, gfx::Rect(parent_rect)); - DCHECK(IsWindow(hwnd())); - installation_job_monitor_thread_->set_plugin_window(hwnd()); + ::GetClientRect(parent_window, &parent_rect); + Create(parent_window, parent_rect, NULL, WS_CHILD | WS_BORDER); + DCHECK(IsWindow()); + installation_job_monitor_thread_->set_plugin_window(m_hWnd); CreateToolTip(); UpdateToolTip(); - UpdateWindow(hwnd()); - ShowWindow(hwnd(), SW_SHOW); + UpdateWindow(); + ShowWindow(SW_SHOW); return true; } @@ -363,11 +360,11 @@ void PluginInstallerImpl::DownloadPlugin() { CComObject<ActiveXInstaller>::CreateInstance(&activex_installer_); activex_installer_->AddRef(); } - activex_installer_->StartDownload(activex_clsid_, activex_codebase_, - hwnd(), kActivexInstallResult); + activex_installer_->StartDownload(activex_clsid_, activex_codebase_, m_hWnd, + kActivexInstallResult); } else { if (!plugin_download_url_for_display_) { - webkit_glue::DownloadUrl(plugin_download_url_, hwnd()); + webkit_glue::DownloadUrl(plugin_download_url_, m_hWnd); } else { default_plugin::g_browser->geturl(instance(), plugin_download_url_.c_str(), @@ -388,11 +385,11 @@ LRESULT PluginInstallerImpl::OnEraseBackGround(UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled) { HDC paint_device_context = reinterpret_cast<HDC>(wparam); RECT erase_rect = {0}; - GetClipBox(paint_device_context, &erase_rect); + ::GetClipBox(paint_device_context, &erase_rect); HBRUSH brush = ::CreateSolidBrush(RGB(252, 235, 162)); DCHECK(brush); - FillRect(paint_device_context, &erase_rect, brush); - DeleteObject(brush); + ::FillRect(paint_device_context, &erase_rect, brush); + ::DeleteObject(brush); return 1; } @@ -417,7 +414,7 @@ bool PluginInstallerImpl::IsRTLLayout() const { LRESULT PluginInstallerImpl::OnPaint(UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled) { PAINTSTRUCT paint_struct = {0}; - BeginPaint(hwnd(), &paint_struct); + BeginPaint(&paint_struct); int save_dc_context = SaveDC(paint_struct.hdc); // The drawing order is as below:- @@ -444,7 +441,7 @@ LRESULT PluginInstallerImpl::OnPaint(UINT message, WPARAM wparam, LPARAM lparam, text_rect.bottom = text_rect.top + device_point.y; RECT client_rect = {0}; - GetClientRect(hwnd(), &client_rect); + GetClientRect(&client_rect); int icon_width = GetSystemMetrics(SM_CXICON); int icon_height = GetSystemMetrics(SM_CYICON); @@ -494,7 +491,7 @@ LRESULT PluginInstallerImpl::OnPaint(UINT message, WPARAM wparam, LPARAM lparam, } RestoreDC(paint_struct.hdc, save_dc_context); - EndPaint(hwnd(), &paint_struct); + EndPaint(&paint_struct); return 0; } @@ -554,7 +551,7 @@ void PluginInstallerImpl::PaintUserActionInformation(HDC paint_dc, void PluginInstallerImpl::ShowInstallDialog() { enable_click_ = false; install_dialog_.Initialize(this, plugin_name_); - install_dialog_.Create(hwnd(), NULL); + install_dialog_.Create(m_hWnd, NULL); install_dialog_.ShowWindow(SW_SHOW); } @@ -584,7 +581,7 @@ LRESULT PluginInstallerImpl::OnLButtonDown(UINT message, WPARAM wparam, LRESULT PluginInstallerImpl::OnSetCursor(UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled) { if (enable_click_) { - SetCursor(LoadCursor(NULL, MAKEINTRESOURCE(IDC_HAND))); + ::SetCursor(LoadCursor(NULL, MAKEINTRESOURCE(IDC_HAND))); return 1; } handled = FALSE; @@ -660,7 +657,7 @@ LRESULT PluginInstallerImpl::OnActiveXInstallResult(UINT message, if (SUCCEEDED(wparam)) { set_plugin_installer_state(PluginInstallerLaunchSuccess); DisplayStatus(IDS_DEFAULT_PLUGIN_REFRESH_PLUGIN_MSG); - PostMessage(hwnd(), kRefreshPluginsMessage, 0, 0); + PostMessage(kRefreshPluginsMessage, 0, 0); } else if ((wparam == INET_E_UNKNOWN_PROTOCOL) || (wparam == HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND))) { set_plugin_installer_state(PluginDownloadFailed); diff --git a/webkit/default_plugin/plugin_impl_win.h b/webkit/default_plugin/plugin_impl_win.h index a0e5596..66a97c6 100644 --- a/webkit/default_plugin/plugin_impl_win.h +++ b/webkit/default_plugin/plugin_impl_win.h @@ -5,10 +5,11 @@ #ifndef WEBKIT_DEFAULT_PLUGIN_PLUGIN_IMPL_WIN_H_ #define WEBKIT_DEFAULT_PLUGIN_PLUGIN_IMPL_WIN_H_ +#include <atlbase.h> +#include <atlwin.h> #include <string> #include <vector> -#include "base/window_impl.h" #include "third_party/npapi/bindings/npapi.h" #include "webkit/default_plugin/install_dialog.h" #include "webkit/default_plugin/plugin_database_handler.h" @@ -35,7 +36,7 @@ class PluginDatabaseHandler; // Provides the plugin installation functionality. This class is // instantiated with the information like the mime type of the // target plugin, the display mode, etc. -class PluginInstallerImpl : public base::WindowImpl { +class PluginInstallerImpl : public CWindowImpl<PluginInstallerImpl> { public: static const int kRefreshPluginsMessage = WM_APP + 1; static const int kInstallMissingPluginMessage = WM_APP + 2; @@ -46,7 +47,7 @@ class PluginInstallerImpl : public base::WindowImpl { explicit PluginInstallerImpl(int16 mode); virtual ~PluginInstallerImpl(); - BEGIN_MSG_MAP_EX(PluginInstallerImpl) + BEGIN_MSG_MAP(PluginInstallerImpl) MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackGround) MESSAGE_HANDLER(WM_PAINT, OnPaint) MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown) @@ -150,6 +151,7 @@ class PluginInstallerImpl : public base::WindowImpl { // activex. int16 NPP_HandleEvent(void* event); + HWND window() const { return m_hWnd; } const std::string& mime_type() const { return mime_type_; } // Replaces a resource string with the placeholder passed in as an argument @@ -373,7 +375,7 @@ class PluginInstallerImpl : public base::WindowImpl { std::string activex_clsid_; CComObject<ActiveXInstaller>* activex_installer_; - DISALLOW_COPY_AND_ASSIGN(PluginInstallerImpl); + DISALLOW_EVIL_CONSTRUCTORS(PluginInstallerImpl); }; diff --git a/webkit/tools/test_shell/foreground_helper.h b/webkit/tools/test_shell/foreground_helper.h index a687c0d..9456ded 100644 --- a/webkit/tools/test_shell/foreground_helper.h +++ b/webkit/tools/test_shell/foreground_helper.h @@ -38,16 +38,16 @@ class ForegroundHelper : public base::WindowImpl { // be in the foreground and allowed to move the target window // into the foreground too. - set_window_style(WS_POPUP); + set_window_ex_style(WS_POPUP); Init(NULL, gfx::Rect()); static const int hotkey_id = 0x0000baba; // Store the target window into our USERDATA for use in our // HotKey handler. - SetWindowLongPtr(hwnd(), GWLP_USERDATA, + SetWindowLongPtr(GetNativeView(), GWLP_USERDATA, reinterpret_cast<ULONG_PTR>(window)); - RegisterHotKey(hwnd(), hotkey_id, 0, VK_F22); + RegisterHotKey(GetNativeView(), hotkey_id, 0, VK_F22); // If the calling thread is not yet a UI thread, call PeekMessage // to ensure creation of its message queue. @@ -72,8 +72,8 @@ class ForegroundHelper : public base::WindowImpl { break; } - UnregisterHotKey(hwnd(), hotkey_id); - DestroyWindow(hwnd()); + UnregisterHotKey(GetNativeView(), hotkey_id); + DestroyWindow(); return S_OK; } @@ -83,7 +83,7 @@ class ForegroundHelper : public base::WindowImpl { WPARAM wparam, LPARAM lparam, BOOL& handled) { - HWND window = reinterpret_cast<HWND>(GetWindowLongPtr(hwnd(), + HWND window = reinterpret_cast<HWND>(GetWindowLongPtr(GetNativeView(), GWLP_USERDATA)); SetForegroundWindow(window); return 1; diff --git a/webkit/webkit.gyp b/webkit/webkit.gyp index 746cf1b..c9028c2 100644 --- a/webkit/webkit.gyp +++ b/webkit/webkit.gyp @@ -1505,9 +1505,6 @@ ], }, { # else: OS=="win" 'sources/': [['exclude', '_posix\\.cc$']], - 'include_dirs': [ - '../chrome/third_party/wtl/include', - ], 'dependencies': [ '../build/win/system.gyp:cygwin', 'activex_shim/activex_shim.gyp:activex_shim', |