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

Unified Diff: chrome/browser/render_widget_host_view_win.cc

Issue 15088: Add support for custom cursors set by windowless plugins. Windowless plugins... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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 | « chrome/browser/render_widget_host_view_win.h ('k') | webkit/glue/chrome_client_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/render_widget_host_view_win.cc
===================================================================
--- chrome/browser/render_widget_host_view_win.cc (revision 7750)
+++ chrome/browser/render_widget_host_view_win.cc (working copy)
@@ -67,8 +67,6 @@
RenderWidgetHostViewWin::RenderWidgetHostViewWin(RenderWidgetHost* widget)
: render_widget_host_(widget),
- cursor_(LoadCursor(NULL, IDC_ARROW)),
- cursor_is_custom_(false),
track_mouse_leave_(false),
ime_notification_(false),
is_hidden_(false),
@@ -85,8 +83,6 @@
}
RenderWidgetHostViewWin::~RenderWidgetHostViewWin() {
- if (cursor_is_custom_)
- DestroyIcon(cursor_);
ResetTooltip();
}
@@ -218,33 +214,22 @@
}
void RenderWidgetHostViewWin::UpdateCursor(const WebCursor& cursor) {
- static HINSTANCE module_handle =
- GetModuleHandle(chrome::kBrowserResourcesDll);
-
- // If the last active cursor was a custom cursor, we need to destroy
- // it before setting the new one.
- if (cursor_is_custom_)
- DestroyIcon(cursor_);
-
- cursor_is_custom_ = cursor.IsCustom();
- if (cursor_is_custom_) {
- cursor_ = cursor.GetCustomCursor();
- } else {
- // We cannot pass in NULL as the module handle as this would only
- // work for standard win32 cursors. We can also receive cursor
- // types which are defined as webkit resources. We need to specify
- // the module handle of chrome.dll while loading these cursors.
- cursor_ = cursor.GetCursor(module_handle);
- }
-
+ current_cursor_ = cursor;
UpdateCursorIfOverSelf();
}
void RenderWidgetHostViewWin::UpdateCursorIfOverSelf() {
static HCURSOR kCursorArrow = LoadCursor(NULL, IDC_ARROW);
static HCURSOR kCursorAppStarting = LoadCursor(NULL, IDC_APPSTARTING);
+ static HINSTANCE module_handle =
+ GetModuleHandle(chrome::kBrowserResourcesDll);
- HCURSOR display_cursor = cursor_;
+ // We cannot pass in NULL as the module handle as this would only work for
+ // standard win32 cursors. We can also receive cursor types which are defined
+ // as webkit resources. We need to specify the module handle of chrome.dll
+ // while loading these cursors.
+ HCURSOR display_cursor = current_cursor_.GetCursor(module_handle);
+
// If a page is in the loading state, we want to show the Arrow+Hourglass
// cursor only when the current cursor is the ARROW cursor. In all other
// cases we should continue to display the current cursor.
@@ -780,6 +765,9 @@
LRESULT RenderWidgetHostViewWin::OnMouseActivate(UINT, WPARAM, LPARAM,
BOOL& handled) {
+ if (!focus_on_show_)
+ return MA_NOACTIVATE;
+
HWND focus_window = GetFocus();
if (!::IsWindow(focus_window) || !IsChild(focus_window)) {
// We handle WM_MOUSEACTIVATE to set focus to the underlying plugin
@@ -916,4 +904,3 @@
render_widget_host_->Shutdown();
// Do not touch any members at this point, |this| has been deleted.
}
-
« no previous file with comments | « chrome/browser/render_widget_host_view_win.h ('k') | webkit/glue/chrome_client_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698