| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |