| 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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 WebStorageNamespace* TestWebViewDelegate::createSessionStorageNamespace( | 334 WebStorageNamespace* TestWebViewDelegate::createSessionStorageNamespace( |
| 335 unsigned quota) { | 335 unsigned quota) { |
| 336 // Enforce quota, ignoring the parameter from WebCore as in Chrome. | 336 // Enforce quota, ignoring the parameter from WebCore as in Chrome. |
| 337 return WebKit::WebStorageNamespace::createSessionStorageNamespace( | 337 return WebKit::WebStorageNamespace::createSessionStorageNamespace( |
| 338 WebStorageNamespace::m_sessionStorageQuota); | 338 WebStorageNamespace::m_sessionStorageQuota); |
| 339 } | 339 } |
| 340 | 340 |
| 341 WebGraphicsContext3D* TestWebViewDelegate::createGraphicsContext3D( | 341 WebGraphicsContext3D* TestWebViewDelegate::createGraphicsContext3D( |
| 342 const WebGraphicsContext3D::Attributes& attributes, | 342 const WebGraphicsContext3D::Attributes& attributes, |
| 343 bool direct) { | 343 bool direct) { |
| 344 if (!shell_->webView()) | |
| 345 return NULL; | |
| 346 return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView( | 344 return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView( |
| 347 attributes, shell_->webView(), direct); | 345 attributes, direct); |
| 348 } | 346 } |
| 349 | 347 |
| 350 void TestWebViewDelegate::didAddMessageToConsole( | 348 void TestWebViewDelegate::didAddMessageToConsole( |
| 351 const WebConsoleMessage& message, const WebString& source_name, | 349 const WebConsoleMessage& message, const WebString& source_name, |
| 352 unsigned source_line) { | 350 unsigned source_line) { |
| 353 logging::LogMessage("CONSOLE", 0).stream() << "\"" | 351 logging::LogMessage("CONSOLE", 0).stream() << "\"" |
| 354 << message.text.utf8().data() | 352 << message.text.utf8().data() |
| 355 << ",\" source: " | 353 << ",\" source: " |
| 356 << source_name.utf8().data() | 354 << source_name.utf8().data() |
| 357 << "(" | 355 << "(" |
| (...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1147 } | 1145 } |
| 1148 | 1146 |
| 1149 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { | 1147 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { |
| 1150 fake_rect_ = rect; | 1148 fake_rect_ = rect; |
| 1151 using_fake_rect_ = true; | 1149 using_fake_rect_ = true; |
| 1152 } | 1150 } |
| 1153 | 1151 |
| 1154 WebRect TestWebViewDelegate::fake_window_rect() { | 1152 WebRect TestWebViewDelegate::fake_window_rect() { |
| 1155 return fake_rect_; | 1153 return fake_rect_; |
| 1156 } | 1154 } |
| OLD | NEW |