OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 prefs->Apply(shell_->webView()); | 322 prefs->Apply(shell_->webView()); |
323 } | 323 } |
324 | 324 |
325 void TestWebViewDelegate::SetAuthorAndUserStylesEnabled(bool is_enabled) { | 325 void TestWebViewDelegate::SetAuthorAndUserStylesEnabled(bool is_enabled) { |
326 WebPreferences* prefs = shell_->GetWebPreferences(); | 326 WebPreferences* prefs = shell_->GetWebPreferences(); |
327 prefs->author_and_user_styles_enabled = is_enabled; | 327 prefs->author_and_user_styles_enabled = is_enabled; |
328 prefs->Apply(shell_->webView()); | 328 prefs->Apply(shell_->webView()); |
329 } | 329 } |
330 | 330 |
331 // WebViewClient ------------------------------------------------------------- | 331 // WebViewClient ------------------------------------------------------------- |
| 332 // TODO(jochen): remove once webkit side is up to date. |
332 WebView* TestWebViewDelegate::createView( | 333 WebView* TestWebViewDelegate::createView( |
333 WebFrame* creator, | 334 WebFrame* creator, |
334 const WebWindowFeatures& window_features, | 335 const WebWindowFeatures& window_features, |
335 const WebString& frame_name) { | 336 const WebString& frame_name) { |
| 337 return createView(creator, WebURLRequest(), window_features, frame_name); |
| 338 } |
| 339 |
| 340 WebView* TestWebViewDelegate::createView( |
| 341 WebFrame* creator, |
| 342 const WebURLRequest& request, |
| 343 const WebWindowFeatures& window_features, |
| 344 const WebString& frame_name) { |
336 return shell_->CreateWebView(); | 345 return shell_->CreateWebView(); |
337 } | 346 } |
338 | 347 |
339 WebWidget* TestWebViewDelegate::createPopupMenu(WebPopupType popup_type) { | 348 WebWidget* TestWebViewDelegate::createPopupMenu(WebPopupType popup_type) { |
340 // TODO(darin): Should we take into account |popup_type| (for activation | 349 // TODO(darin): Should we take into account |popup_type| (for activation |
341 // purpose)? | 350 // purpose)? |
342 return shell_->CreatePopupWidget(); | 351 return shell_->CreatePopupWidget(); |
343 } | 352 } |
344 | 353 |
345 WebStorageNamespace* TestWebViewDelegate::createSessionStorageNamespace( | 354 WebStorageNamespace* TestWebViewDelegate::createSessionStorageNamespace( |
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1321 } | 1330 } |
1322 | 1331 |
1323 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { | 1332 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { |
1324 fake_rect_ = rect; | 1333 fake_rect_ = rect; |
1325 using_fake_rect_ = true; | 1334 using_fake_rect_ = true; |
1326 } | 1335 } |
1327 | 1336 |
1328 WebRect TestWebViewDelegate::fake_window_rect() { | 1337 WebRect TestWebViewDelegate::fake_window_rect() { |
1329 return fake_rect_; | 1338 return fake_rect_; |
1330 } | 1339 } |
OLD | NEW |