| 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 #include <gdk/gdkx.h> | 10 #include <gdk/gdkx.h> |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 121 |
| 122 void TestWebViewDelegate::Show(WebWidget* webwidget, | 122 void TestWebViewDelegate::Show(WebWidget* webwidget, |
| 123 WindowOpenDisposition disposition) { | 123 WindowOpenDisposition disposition) { |
| 124 WebWidgetHost* host = GetHostForWidget(webwidget); | 124 WebWidgetHost* host = GetHostForWidget(webwidget); |
| 125 GtkWidget* drawing_area = host->view_handle(); | 125 GtkWidget* drawing_area = host->view_handle(); |
| 126 GtkWidget* window = | 126 GtkWidget* window = |
| 127 gtk_widget_get_parent(gtk_widget_get_parent(drawing_area)); | 127 gtk_widget_get_parent(gtk_widget_get_parent(drawing_area)); |
| 128 gtk_widget_show_all(window); | 128 gtk_widget_show_all(window); |
| 129 } | 129 } |
| 130 | 130 |
| 131 void TestWebViewDelegate::ShowAsPopupWithItems( | |
| 132 WebWidget* webwidget, | |
| 133 const WebRect& bounds, | |
| 134 int item_height, | |
| 135 int selected_index, | |
| 136 const std::vector<WebMenuItem>& items) { | |
| 137 NOTREACHED(); | |
| 138 } | |
| 139 | |
| 140 void TestWebViewDelegate::CloseWidgetSoon(WebWidget* webwidget) { | 131 void TestWebViewDelegate::CloseWidgetSoon(WebWidget* webwidget) { |
| 141 if (webwidget == shell_->webView()) { | 132 if (webwidget == shell_->webView()) { |
| 142 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableFunction( | 133 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableFunction( |
| 143 >k_widget_destroy, GTK_WIDGET(shell_->mainWnd()))); | 134 >k_widget_destroy, GTK_WIDGET(shell_->mainWnd()))); |
| 144 } else if (webwidget == shell_->popup()) { | 135 } else if (webwidget == shell_->popup()) { |
| 145 shell_->ClosePopup(); | 136 shell_->ClosePopup(); |
| 146 } | 137 } |
| 147 } | 138 } |
| 148 | 139 |
| 149 void TestWebViewDelegate::SetCursor(WebWidget* webwidget, | 140 void TestWebViewDelegate::SetCursor(WebWidget* webwidget, |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 // Private methods ----------------------------------------------------------- | 256 // Private methods ----------------------------------------------------------- |
| 266 | 257 |
| 267 void TestWebViewDelegate::SetPageTitle(const std::wstring& title) { | 258 void TestWebViewDelegate::SetPageTitle(const std::wstring& title) { |
| 268 gtk_window_set_title(GTK_WINDOW(shell_->mainWnd()), | 259 gtk_window_set_title(GTK_WINDOW(shell_->mainWnd()), |
| 269 ("Test Shell - " + WideToUTF8(title)).c_str()); | 260 ("Test Shell - " + WideToUTF8(title)).c_str()); |
| 270 } | 261 } |
| 271 | 262 |
| 272 void TestWebViewDelegate::SetAddressBarURL(const GURL& url) { | 263 void TestWebViewDelegate::SetAddressBarURL(const GURL& url) { |
| 273 gtk_entry_set_text(GTK_ENTRY(shell_->editWnd()), url.spec().c_str()); | 264 gtk_entry_set_text(GTK_ENTRY(shell_->editWnd()), url.spec().c_str()); |
| 274 } | 265 } |
| OLD | NEW |