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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 prefs->Apply(shell_->webView()); | 311 prefs->Apply(shell_->webView()); |
312 } | 312 } |
313 | 313 |
314 void TestWebViewDelegate::SetAuthorAndUserStylesEnabled(bool is_enabled) { | 314 void TestWebViewDelegate::SetAuthorAndUserStylesEnabled(bool is_enabled) { |
315 WebPreferences* prefs = shell_->GetWebPreferences(); | 315 WebPreferences* prefs = shell_->GetWebPreferences(); |
316 prefs->author_and_user_styles_enabled = is_enabled; | 316 prefs->author_and_user_styles_enabled = is_enabled; |
317 prefs->Apply(shell_->webView()); | 317 prefs->Apply(shell_->webView()); |
318 } | 318 } |
319 | 319 |
320 // WebViewClient ------------------------------------------------------------- | 320 // WebViewClient ------------------------------------------------------------- |
321 // TODO(creis): Remove as part of http://crbug.com/69267. | |
322 WebView* TestWebViewDelegate::createView( | 321 WebView* TestWebViewDelegate::createView( |
323 WebFrame* creator, | 322 WebFrame* creator, |
324 const WebURLRequest& request, | 323 const WebURLRequest& request, |
325 const WebWindowFeatures& window_features, | 324 const WebWindowFeatures& window_features, |
326 const WebString& frame_name, | 325 const WebString& frame_name, |
327 WebNavigationPolicy policy) { | 326 WebNavigationPolicy policy) { |
328 return createView(creator, request, window_features, frame_name); | |
329 } | |
330 WebView* TestWebViewDelegate::createView( | |
331 WebFrame* creator, | |
332 const WebURLRequest& request, | |
333 const WebWindowFeatures& window_features, | |
334 const WebString& frame_name) { | |
335 return shell_->CreateWebView(); | 327 return shell_->CreateWebView(); |
336 } | 328 } |
337 | 329 |
338 WebWidget* TestWebViewDelegate::createPopupMenu(WebPopupType popup_type) { | 330 WebWidget* TestWebViewDelegate::createPopupMenu(WebPopupType popup_type) { |
339 // TODO(darin): Should we take into account |popup_type| (for activation | 331 // TODO(darin): Should we take into account |popup_type| (for activation |
340 // purpose)? | 332 // purpose)? |
341 return shell_->CreatePopupWidget(); | 333 return shell_->CreatePopupWidget(); |
342 } | 334 } |
343 | 335 |
344 WebStorageNamespace* TestWebViewDelegate::createSessionStorageNamespace( | 336 WebStorageNamespace* TestWebViewDelegate::createSessionStorageNamespace( |
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1159 } | 1151 } |
1160 | 1152 |
1161 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { | 1153 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { |
1162 fake_rect_ = rect; | 1154 fake_rect_ = rect; |
1163 using_fake_rect_ = true; | 1155 using_fake_rect_ = true; |
1164 } | 1156 } |
1165 | 1157 |
1166 WebRect TestWebViewDelegate::fake_window_rect() { | 1158 WebRect TestWebViewDelegate::fake_window_rect() { |
1167 return fake_rect_; | 1159 return fake_rect_; |
1168 } | 1160 } |
OLD | NEW |