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

Side by Side Diff: webkit/tools/test_shell/test_webview_delegate_gtk.cc

Issue 62087: Fix a selection clipboard leak. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 8 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
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host_view_gtk.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 GtkTargetList* target_list = gtk_target_list_new(NULL, 0); 251 GtkTargetList* target_list = gtk_target_list_new(NULL, 0);
252 gtk_target_list_add(target_list, GetTextHtmlAtom(), 0, TEXT_HTML); 252 gtk_target_list_add(target_list, GetTextHtmlAtom(), 0, TEXT_HTML);
253 gtk_target_list_add_text_targets(target_list, PLAIN_TEXT); 253 gtk_target_list_add_text_targets(target_list, PLAIN_TEXT);
254 254
255 gint num_targets = 0; 255 gint num_targets = 0;
256 GtkTargetEntry* targets = gtk_target_table_new_from_list(target_list, 256 GtkTargetEntry* targets = gtk_target_table_new_from_list(target_list,
257 &num_targets); 257 &num_targets);
258 gtk_clipboard_set_with_data(clipboard, targets, num_targets, 258 gtk_clipboard_set_with_data(clipboard, targets, num_targets,
259 SelectionClipboardGetContents, NULL, 259 SelectionClipboardGetContents, NULL,
260 shell_->webView()); 260 shell_->webView());
261 gtk_target_list_unref(target_list);
261 gtk_target_table_free(targets, num_targets); 262 gtk_target_table_free(targets, num_targets);
262 } 263 }
263 264
264 // Private methods ----------------------------------------------------------- 265 // Private methods -----------------------------------------------------------
265 266
266 void TestWebViewDelegate::SetPageTitle(const std::wstring& title) { 267 void TestWebViewDelegate::SetPageTitle(const std::wstring& title) {
267 gtk_window_set_title(GTK_WINDOW(shell_->mainWnd()), 268 gtk_window_set_title(GTK_WINDOW(shell_->mainWnd()),
268 ("Test Shell - " + WideToUTF8(title)).c_str()); 269 ("Test Shell - " + WideToUTF8(title)).c_str());
269 } 270 }
270 271
271 void TestWebViewDelegate::SetAddressBarURL(const GURL& url) { 272 void TestWebViewDelegate::SetAddressBarURL(const GURL& url) {
272 gtk_entry_set_text(GTK_ENTRY(shell_->editWnd()), url.spec().c_str()); 273 gtk_entry_set_text(GTK_ENTRY(shell_->editWnd()), url.spec().c_str());
273 } 274 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host_view_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698