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

Unified Diff: webkit/default_plugin/plugin_impl_win.cc

Issue 165469: Change PluginInstallImpl to use base::WindowImpl instead of CWindowImpl to re... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 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
« no previous file with comments | « webkit/default_plugin/plugin_impl_win.h ('k') | webkit/tools/test_shell/foreground_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/default_plugin/plugin_impl_win.cc
===================================================================
--- webkit/default_plugin/plugin_impl_win.cc (revision 23329)
+++ webkit/default_plugin/plugin_impl_win.cc (working copy)
@@ -44,10 +44,10 @@
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 @@
}
if (tooltip_)
- ::DestroyWindow(tooltip_);
+ DestroyWindow(tooltip_);
}
bool PluginInstallerImpl::Initialize(HINSTANCE module_handle, NPP instance,
@@ -118,8 +118,8 @@
if (install_dialog_.IsWindow()) {
install_dialog_.DestroyWindow();
}
- if (IsWindow()) {
- DestroyWindow();
+ if (IsWindow(hwnd())) {
+ DestroyWindow(hwnd());
}
}
@@ -168,12 +168,12 @@
}
void PluginInstallerImpl::RefreshDisplay() {
- if (!IsWindow())
+ if (!IsWindow(hwnd()))
return;
UpdateToolTip();
- InvalidateRect(NULL, TRUE);
- UpdateWindow();
+ InvalidateRect(hwnd(), NULL, TRUE);
+ UpdateWindow(hwnd());
}
bool PluginInstallerImpl::CreateToolTip() {
@@ -182,16 +182,16 @@
WS_POPUP | TTS_ALWAYSTIP,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
- m_hWnd, NULL, NULL, NULL);
+ 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 = m_hWnd;
+ tool_info.hwnd = hwnd();
tool_info.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
- tool_info.uId = reinterpret_cast<UINT_PTR>(m_hWnd);
+ tool_info.uId = reinterpret_cast<UINT_PTR>(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 @@
TOOLINFO tool_info = {0};
tool_info.cbSize = sizeof(tool_info);
- tool_info.hwnd = m_hWnd;
+ tool_info.hwnd = hwnd();
tool_info.uFlags = TTF_IDISHWND;
- tool_info.uId = reinterpret_cast<UINT_PTR>(m_hWnd);
+ tool_info.uId = reinterpret_cast<UINT_PTR>(hwnd());
tool_info.lpszText = const_cast<LPWSTR>(tip.c_str());
SendMessage(tooltip_, TTM_UPDATETIPTEXT, 0, (LPARAM)&tool_info);
}
@@ -316,9 +316,9 @@
}
bool PluginInstallerImpl::SetWindow(HWND parent_window) {
- if (!::IsWindow(parent_window)) {
+ if (!IsWindow(parent_window)) {
// No window created yet. Ignore this call.
- if (!IsWindow())
+ if (!IsWindow(hwnd()))
return true;
// Parent window has been destroyed.
Shutdown();
@@ -327,22 +327,25 @@
RECT parent_rect = {0};
- if (IsWindow()) {
- ::GetClientRect(parent_window, &parent_rect);
- SetWindowPos(NULL, &parent_rect, SWP_SHOWWINDOW);
+ 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);
return true;
}
// First time in -- no window created by plugin yet.
- ::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);
+ 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());
CreateToolTip();
UpdateToolTip();
- UpdateWindow();
- ShowWindow(SW_SHOW);
+ UpdateWindow(hwnd());
+ ShowWindow(hwnd(), SW_SHOW);
return true;
}
@@ -360,11 +363,11 @@
CComObject<ActiveXInstaller>::CreateInstance(&activex_installer_);
activex_installer_->AddRef();
}
- activex_installer_->StartDownload(activex_clsid_, activex_codebase_, m_hWnd,
- kActivexInstallResult);
+ activex_installer_->StartDownload(activex_clsid_, activex_codebase_,
+ hwnd(), kActivexInstallResult);
} else {
if (!plugin_download_url_for_display_) {
- webkit_glue::DownloadUrl(plugin_download_url_, m_hWnd);
+ webkit_glue::DownloadUrl(plugin_download_url_, hwnd());
} else {
default_plugin::g_browser->geturl(instance(),
plugin_download_url_.c_str(),
@@ -385,11 +388,11 @@
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;
}
@@ -414,7 +417,7 @@
LRESULT PluginInstallerImpl::OnPaint(UINT message, WPARAM wparam, LPARAM lparam,
BOOL& handled) {
PAINTSTRUCT paint_struct = {0};
- BeginPaint(&paint_struct);
+ BeginPaint(hwnd(), &paint_struct);
int save_dc_context = SaveDC(paint_struct.hdc);
// The drawing order is as below:-
@@ -441,7 +444,7 @@
text_rect.bottom = text_rect.top + device_point.y;
RECT client_rect = {0};
- GetClientRect(&client_rect);
+ GetClientRect(hwnd(), &client_rect);
int icon_width = GetSystemMetrics(SM_CXICON);
int icon_height = GetSystemMetrics(SM_CYICON);
@@ -491,7 +494,7 @@
}
RestoreDC(paint_struct.hdc, save_dc_context);
- EndPaint(&paint_struct);
+ EndPaint(hwnd(), &paint_struct);
return 0;
}
@@ -551,7 +554,7 @@
void PluginInstallerImpl::ShowInstallDialog() {
enable_click_ = false;
install_dialog_.Initialize(this, plugin_name_);
- install_dialog_.Create(m_hWnd, NULL);
+ install_dialog_.Create(hwnd(), NULL);
install_dialog_.ShowWindow(SW_SHOW);
}
@@ -581,7 +584,7 @@
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;
@@ -657,7 +660,7 @@
if (SUCCEEDED(wparam)) {
set_plugin_installer_state(PluginInstallerLaunchSuccess);
DisplayStatus(IDS_DEFAULT_PLUGIN_REFRESH_PLUGIN_MSG);
- PostMessage(kRefreshPluginsMessage, 0, 0);
+ PostMessage(hwnd(), kRefreshPluginsMessage, 0, 0);
} else if ((wparam == INET_E_UNKNOWN_PROTOCOL) ||
(wparam == HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND))) {
set_plugin_installer_state(PluginDownloadFailed);
« no previous file with comments | « webkit/default_plugin/plugin_impl_win.h ('k') | webkit/tools/test_shell/foreground_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698