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

Side by Side Diff: webkit/tools/test_shell/test_webview_delegate_gtk.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file was forked off the Mac port. 5 // This file was forked off the Mac port.
6 6
7 #include "webkit/tools/test_shell/test_webview_delegate.h" 7 #include "webkit/tools/test_shell/test_webview_delegate.h"
8 8
9 #include <gtk/gtk.h> 9 #include <gtk/gtk.h>
10 10
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 if (webwidget == shell_->webView()) { 104 if (webwidget == shell_->webView()) {
105 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableFunction( 105 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableFunction(
106 &gtk_widget_destroy, GTK_WIDGET(shell_->mainWnd()))); 106 &gtk_widget_destroy, GTK_WIDGET(shell_->mainWnd())));
107 } else if (webwidget == shell_->popup()) { 107 } else if (webwidget == shell_->popup()) {
108 shell_->ClosePopup(); 108 shell_->ClosePopup();
109 } 109 }
110 } 110 }
111 111
112 void TestWebViewDelegate::SetCursor(WebWidget* webwidget, 112 void TestWebViewDelegate::SetCursor(WebWidget* webwidget,
113 const WebCursor& cursor) { 113 const WebCursor& cursor) {
114 GdkCursorType cursor_type = cursor.GetCursorType(); 114 current_cursor_ = cursor;
115 GdkCursorType cursor_type = current_cursor_.GetCursorType();
115 GdkCursor* gdk_cursor; 116 GdkCursor* gdk_cursor;
116 if (cursor_type == GDK_CURSOR_IS_PIXMAP) { 117 if (cursor_type == GDK_CURSOR_IS_PIXMAP) {
117 // TODO(port): WebKit bug https://bugs.webkit.org/show_bug.cgi?id=16388 is 118 // TODO(port): WebKit bug https://bugs.webkit.org/show_bug.cgi?id=16388 is
118 // that calling gdk_window_set_cursor repeatedly is expensive. We should 119 // that calling gdk_window_set_cursor repeatedly is expensive. We should
119 // avoid it here where possible. 120 // avoid it here where possible.
120 gdk_cursor = cursor.GetCustomCursor(); 121 gdk_cursor = current_cursor_.GetCustomCursor();
121 } else { 122 } else {
122 // Optimize the common case, where the cursor hasn't changed. 123 // Optimize the common case, where the cursor hasn't changed.
123 // However, we can switch between different pixmaps, so only on the 124 // However, we can switch between different pixmaps, so only on the
124 // non-pixmap branch. 125 // non-pixmap branch.
125 if (cursor_type_ == cursor_type) 126 if (cursor_type_ == cursor_type)
126 return; 127 return;
127 gdk_cursor = gdk_cursor_new(cursor_type); 128 gdk_cursor = gdk_cursor_new(cursor_type);
128 } 129 }
129 cursor_type_ = cursor_type; 130 cursor_type_ = cursor_type;
130 gdk_window_set_cursor(shell_->webViewWnd()->window, gdk_cursor); 131 gdk_window_set_cursor(shell_->webViewWnd()->window, gdk_cursor);
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 // Private methods ----------------------------------------------------------- 214 // Private methods -----------------------------------------------------------
214 215
215 void TestWebViewDelegate::SetPageTitle(const std::wstring& title) { 216 void TestWebViewDelegate::SetPageTitle(const std::wstring& title) {
216 gtk_window_set_title(GTK_WINDOW(shell_->mainWnd()), 217 gtk_window_set_title(GTK_WINDOW(shell_->mainWnd()),
217 ("Test Shell - " + WideToUTF8(title)).c_str()); 218 ("Test Shell - " + WideToUTF8(title)).c_str());
218 } 219 }
219 220
220 void TestWebViewDelegate::SetAddressBarURL(const GURL& url) { 221 void TestWebViewDelegate::SetAddressBarURL(const GURL& url) {
221 gtk_entry_set_text(GTK_ENTRY(shell_->editWnd()), url.spec().c_str()); 222 gtk_entry_set_text(GTK_ENTRY(shell_->editWnd()), url.spec().c_str());
222 } 223 }
OLDNEW
« no previous file with comments | « webkit/tools/test_shell/test_webview_delegate.h ('k') | webkit/tools/test_shell/test_webview_delegate_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698