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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 } | 328 } |
329 | 329 |
330 WebWidget* TestWebViewDelegate::createPopupMenu(WebPopupType popup_type) { | 330 WebWidget* TestWebViewDelegate::createPopupMenu(WebPopupType popup_type) { |
331 // TODO(darin): Should we take into account |popup_type| (for activation | 331 // TODO(darin): Should we take into account |popup_type| (for activation |
332 // purpose)? | 332 // purpose)? |
333 return shell_->CreatePopupWidget(); | 333 return shell_->CreatePopupWidget(); |
334 } | 334 } |
335 | 335 |
336 WebStorageNamespace* TestWebViewDelegate::createSessionStorageNamespace( | 336 WebStorageNamespace* TestWebViewDelegate::createSessionStorageNamespace( |
337 unsigned quota) { | 337 unsigned quota) { |
338 #ifdef ENABLE_NEW_DOM_STORAGE_BACKEND | |
339 return SimpleDomStorageSystem::instance().CreateSessionStorageNamespace(); | 338 return SimpleDomStorageSystem::instance().CreateSessionStorageNamespace(); |
340 #else | |
341 // Enforce quota, ignoring the parameter from WebCore as in Chrome. | |
342 return WebKit::WebStorageNamespace::createSessionStorageNamespace( | |
343 WebStorageNamespace::m_sessionStorageQuota); | |
344 #endif | |
345 } | 339 } |
346 | 340 |
347 WebGraphicsContext3D* TestWebViewDelegate::createGraphicsContext3D( | 341 WebGraphicsContext3D* TestWebViewDelegate::createGraphicsContext3D( |
348 const WebGraphicsContext3D::Attributes& attributes) { | 342 const WebGraphicsContext3D::Attributes& attributes) { |
349 return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView( | 343 return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView( |
350 attributes, true); | 344 attributes, true); |
351 } | 345 } |
352 | 346 |
353 void TestWebViewDelegate::didAddMessageToConsole( | 347 void TestWebViewDelegate::didAddMessageToConsole( |
354 const WebConsoleMessage& message, const WebString& source_name, | 348 const WebConsoleMessage& message, const WebString& source_name, |
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1150 } | 1144 } |
1151 | 1145 |
1152 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { | 1146 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { |
1153 fake_rect_ = rect; | 1147 fake_rect_ = rect; |
1154 using_fake_rect_ = true; | 1148 using_fake_rect_ = true; |
1155 } | 1149 } |
1156 | 1150 |
1157 WebRect TestWebViewDelegate::fake_window_rect() { | 1151 WebRect TestWebViewDelegate::fake_window_rect() { |
1158 return fake_rect_; | 1152 return fake_rect_; |
1159 } | 1153 } |
OLD | NEW |