| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 108 |
| 109 void TestWebViewDelegate::Show(WebWidget* webwidget, | 109 void TestWebViewDelegate::Show(WebWidget* webwidget, |
| 110 WindowOpenDisposition disposition) { | 110 WindowOpenDisposition disposition) { |
| 111 WebWidgetHost* host = GetHostForWidget(webwidget); | 111 WebWidgetHost* host = GetHostForWidget(webwidget); |
| 112 GtkWidget* drawing_area = host->view_handle(); | 112 GtkWidget* drawing_area = host->view_handle(); |
| 113 GtkWidget* window = | 113 GtkWidget* window = |
| 114 gtk_widget_get_parent(gtk_widget_get_parent(drawing_area)); | 114 gtk_widget_get_parent(gtk_widget_get_parent(drawing_area)); |
| 115 gtk_widget_show_all(window); | 115 gtk_widget_show_all(window); |
| 116 } | 116 } |
| 117 | 117 |
| 118 void TestWebViewDelegate::ShowWithItems(WebWidget* webwidget, | 118 void TestWebViewDelegate::ShowAsPopupWithItems( |
| 119 const WebRect& bounds, | 119 WebWidget* webwidget, |
| 120 int item_height, | 120 const WebRect& bounds, |
| 121 int selected_index, | 121 int item_height, |
| 122 const std::vector<MenuItem>& items) { | 122 int selected_index, |
| 123 NOTIMPLEMENTED(); | 123 const std::vector<WebMenuItem>& items) { |
| 124 NOTREACHED(); |
| 124 } | 125 } |
| 125 | 126 |
| 126 void TestWebViewDelegate::CloseWidgetSoon(WebWidget* webwidget) { | 127 void TestWebViewDelegate::CloseWidgetSoon(WebWidget* webwidget) { |
| 127 if (webwidget == shell_->webView()) { | 128 if (webwidget == shell_->webView()) { |
| 128 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableFunction( | 129 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableFunction( |
| 129 >k_widget_destroy, GTK_WIDGET(shell_->mainWnd()))); | 130 >k_widget_destroy, GTK_WIDGET(shell_->mainWnd()))); |
| 130 } else if (webwidget == shell_->popup()) { | 131 } else if (webwidget == shell_->popup()) { |
| 131 shell_->ClosePopup(); | 132 shell_->ClosePopup(); |
| 132 } | 133 } |
| 133 } | 134 } |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 // Private methods ----------------------------------------------------------- | 269 // Private methods ----------------------------------------------------------- |
| 269 | 270 |
| 270 void TestWebViewDelegate::SetPageTitle(const std::wstring& title) { | 271 void TestWebViewDelegate::SetPageTitle(const std::wstring& title) { |
| 271 gtk_window_set_title(GTK_WINDOW(shell_->mainWnd()), | 272 gtk_window_set_title(GTK_WINDOW(shell_->mainWnd()), |
| 272 ("Test Shell - " + WideToUTF8(title)).c_str()); | 273 ("Test Shell - " + WideToUTF8(title)).c_str()); |
| 273 } | 274 } |
| 274 | 275 |
| 275 void TestWebViewDelegate::SetAddressBarURL(const GURL& url) { | 276 void TestWebViewDelegate::SetAddressBarURL(const GURL& url) { |
| 276 gtk_entry_set_text(GTK_ENTRY(shell_->editWnd()), url.spec().c_str()); | 277 gtk_entry_set_text(GTK_ENTRY(shell_->editWnd()), url.spec().c_str()); |
| 277 } | 278 } |
| OLD | NEW |