OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 contains the implementation of TestWebViewDelegate, which serves | 5 // This file contains the implementation of TestWebViewDelegate, which serves |
6 // as the WebViewDelegate for the TestShellWebHost. The host is expected to | 6 // as the WebViewDelegate for the TestShellWebHost. The host is expected to |
7 // have initialized a MessageLoop before these methods are called. | 7 // have initialized a MessageLoop before these methods are called. |
8 | 8 |
9 #include "webkit/tools/test_shell/test_webview_delegate.h" | 9 #include "webkit/tools/test_shell/test_webview_delegate.h" |
10 | 10 |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 prefs->Apply(shell_->webView()); | 310 prefs->Apply(shell_->webView()); |
311 } | 311 } |
312 | 312 |
313 void TestWebViewDelegate::SetAuthorAndUserStylesEnabled(bool is_enabled) { | 313 void TestWebViewDelegate::SetAuthorAndUserStylesEnabled(bool is_enabled) { |
314 WebPreferences* prefs = shell_->GetWebPreferences(); | 314 WebPreferences* prefs = shell_->GetWebPreferences(); |
315 prefs->author_and_user_styles_enabled = is_enabled; | 315 prefs->author_and_user_styles_enabled = is_enabled; |
316 prefs->Apply(shell_->webView()); | 316 prefs->Apply(shell_->webView()); |
317 } | 317 } |
318 | 318 |
319 // WebViewClient ------------------------------------------------------------- | 319 // WebViewClient ------------------------------------------------------------- |
| 320 // TODO(creis): Remove as part of http://crbug.com/69267. |
320 WebView* TestWebViewDelegate::createView( | 321 WebView* TestWebViewDelegate::createView( |
321 WebFrame* creator, | 322 WebFrame* creator, |
322 const WebURLRequest& request, | 323 const WebURLRequest& request, |
| 324 const WebWindowFeatures& window_features, |
| 325 const WebString& frame_name, |
| 326 WebNavigationPolicy policy) { |
| 327 return createView(creator, request, window_features, frame_name); |
| 328 } |
| 329 WebView* TestWebViewDelegate::createView( |
| 330 WebFrame* creator, |
| 331 const WebURLRequest& request, |
323 const WebWindowFeatures& window_features, | 332 const WebWindowFeatures& window_features, |
324 const WebString& frame_name) { | 333 const WebString& frame_name) { |
325 return shell_->CreateWebView(); | 334 return shell_->CreateWebView(); |
326 } | 335 } |
327 | 336 |
328 WebWidget* TestWebViewDelegate::createPopupMenu(WebPopupType popup_type) { | 337 WebWidget* TestWebViewDelegate::createPopupMenu(WebPopupType popup_type) { |
329 // TODO(darin): Should we take into account |popup_type| (for activation | 338 // TODO(darin): Should we take into account |popup_type| (for activation |
330 // purpose)? | 339 // purpose)? |
331 return shell_->CreatePopupWidget(); | 340 return shell_->CreatePopupWidget(); |
332 } | 341 } |
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1145 } | 1154 } |
1146 | 1155 |
1147 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { | 1156 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { |
1148 fake_rect_ = rect; | 1157 fake_rect_ = rect; |
1149 using_fake_rect_ = true; | 1158 using_fake_rect_ = true; |
1150 } | 1159 } |
1151 | 1160 |
1152 WebRect TestWebViewDelegate::fake_window_rect() { | 1161 WebRect TestWebViewDelegate::fake_window_rect() { |
1153 return fake_rect_; | 1162 return fake_rect_; |
1154 } | 1163 } |
OLD | NEW |