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. | |
333 WebView* TestWebViewDelegate::createView( | |
334 WebFrame* creator, | |
335 const WebWindowFeatures& window_features, | |
336 const WebString& frame_name) { | |
337 return createView(creator, WebURLRequest(), window_features, frame_name); | |
338 } | |
339 | |
340 WebView* TestWebViewDelegate::createView( | 332 WebView* TestWebViewDelegate::createView( |
341 WebFrame* creator, | 333 WebFrame* creator, |
342 const WebURLRequest& request, | 334 const WebURLRequest& request, |
343 const WebWindowFeatures& window_features, | 335 const WebWindowFeatures& window_features, |
344 const WebString& frame_name) { | 336 const WebString& frame_name) { |
345 return shell_->CreateWebView(); | 337 return shell_->CreateWebView(); |
346 } | 338 } |
347 | 339 |
348 WebWidget* TestWebViewDelegate::createPopupMenu(WebPopupType popup_type) { | 340 WebWidget* TestWebViewDelegate::createPopupMenu(WebPopupType popup_type) { |
349 // TODO(darin): Should we take into account |popup_type| (for activation | 341 // TODO(darin): Should we take into account |popup_type| (for activation |
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1330 } | 1322 } |
1331 | 1323 |
1332 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { | 1324 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { |
1333 fake_rect_ = rect; | 1325 fake_rect_ = rect; |
1334 using_fake_rect_ = true; | 1326 using_fake_rect_ = true; |
1335 } | 1327 } |
1336 | 1328 |
1337 WebRect TestWebViewDelegate::fake_window_rect() { | 1329 WebRect TestWebViewDelegate::fake_window_rect() { |
1338 return fake_rect_; | 1330 return fake_rect_; |
1339 } | 1331 } |
OLD | NEW |