| 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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 // Enforce quota, ignoring the parameter from WebCore as in Chrome. | 333 // Enforce quota, ignoring the parameter from WebCore as in Chrome. |
| 334 return WebKit::WebStorageNamespace::createSessionStorageNamespace( | 334 return WebKit::WebStorageNamespace::createSessionStorageNamespace( |
| 335 WebStorageNamespace::m_sessionStorageQuota); | 335 WebStorageNamespace::m_sessionStorageQuota); |
| 336 } | 336 } |
| 337 | 337 |
| 338 WebGraphicsContext3D* TestWebViewDelegate::createGraphicsContext3D( | 338 WebGraphicsContext3D* TestWebViewDelegate::createGraphicsContext3D( |
| 339 const WebGraphicsContext3D::Attributes& attributes, | 339 const WebGraphicsContext3D::Attributes& attributes, |
| 340 bool direct) { | 340 bool direct) { |
| 341 if (!shell_->webView()) | 341 if (!shell_->webView()) |
| 342 return NULL; | 342 return NULL; |
| 343 scoped_ptr<WebGraphicsContext3D> context( | 343 return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView( |
| 344 new webkit::gpu::WebGraphicsContext3DInProcessImpl( | 344 attributes, shell_->webView(), direct); |
| 345 gfx::kNullPluginWindow, NULL)); | |
| 346 if (!context->initialize(attributes, shell_->webView(), direct)) | |
| 347 return NULL; | |
| 348 return context.release(); | |
| 349 } | 345 } |
| 350 | 346 |
| 351 void TestWebViewDelegate::didAddMessageToConsole( | 347 void TestWebViewDelegate::didAddMessageToConsole( |
| 352 const WebConsoleMessage& message, const WebString& source_name, | 348 const WebConsoleMessage& message, const WebString& source_name, |
| 353 unsigned source_line) { | 349 unsigned source_line) { |
| 354 logging::LogMessage("CONSOLE", 0).stream() << "\"" | 350 logging::LogMessage("CONSOLE", 0).stream() << "\"" |
| 355 << message.text.utf8().data() | 351 << message.text.utf8().data() |
| 356 << ",\" source: " | 352 << ",\" source: " |
| 357 << source_name.utf8().data() | 353 << source_name.utf8().data() |
| 358 << "(" | 354 << "(" |
| (...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1161 } | 1157 } |
| 1162 | 1158 |
| 1163 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { | 1159 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { |
| 1164 fake_rect_ = rect; | 1160 fake_rect_ = rect; |
| 1165 using_fake_rect_ = true; | 1161 using_fake_rect_ = true; |
| 1166 } | 1162 } |
| 1167 | 1163 |
| 1168 WebRect TestWebViewDelegate::fake_window_rect() { | 1164 WebRect TestWebViewDelegate::fake_window_rect() { |
| 1169 return fake_rect_; | 1165 return fake_rect_; |
| 1170 } | 1166 } |
| OLD | NEW |