| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "components/test_runner/test_plugin.h" | 5 #include "components/test_runner/test_plugin.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/memory/shared_memory.h" | 13 #include "base/memory/shared_memory.h" |
| 14 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
| 15 #include "cc/blink/web_layer_impl.h" | 15 #include "cc/blink/web_layer_impl.h" |
| 16 #include "cc/layers/layer_settings.h" | |
| 17 #include "cc/layers/texture_layer.h" | 16 #include "cc/layers/texture_layer.h" |
| 18 #include "cc/resources/shared_bitmap_manager.h" | 17 #include "cc/resources/shared_bitmap_manager.h" |
| 19 #include "components/test_runner/web_test_delegate.h" | 18 #include "components/test_runner/web_test_delegate.h" |
| 20 #include "third_party/WebKit/public/platform/Platform.h" | 19 #include "third_party/WebKit/public/platform/Platform.h" |
| 21 #include "third_party/WebKit/public/platform/WebCompositorSupport.h" | 20 #include "third_party/WebKit/public/platform/WebCompositorSupport.h" |
| 22 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | 21 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
| 23 #include "third_party/WebKit/public/platform/WebTaskRunner.h" | 22 #include "third_party/WebKit/public/platform/WebTaskRunner.h" |
| 24 #include "third_party/WebKit/public/platform/WebThread.h" | 23 #include "third_party/WebKit/public/platform/WebThread.h" |
| 25 #include "third_party/WebKit/public/platform/WebTraceLocation.h" | 24 #include "third_party/WebKit/public/platform/WebTraceLocation.h" |
| 26 #include "third_party/WebKit/public/web/WebFrame.h" | 25 #include "third_party/WebKit/public/web/WebFrame.h" |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 } | 200 } |
| 202 | 201 |
| 203 bool TestPlugin::initialize(blink::WebPluginContainer* container) { | 202 bool TestPlugin::initialize(blink::WebPluginContainer* container) { |
| 204 blink::WebGraphicsContext3D::Attributes attrs; | 203 blink::WebGraphicsContext3D::Attributes attrs; |
| 205 context_ = | 204 context_ = |
| 206 blink::Platform::current()->createOffscreenGraphicsContext3D(attrs); | 205 blink::Platform::current()->createOffscreenGraphicsContext3D(attrs); |
| 207 | 206 |
| 208 if (!InitScene()) | 207 if (!InitScene()) |
| 209 return false; | 208 return false; |
| 210 | 209 |
| 211 layer_ = cc::TextureLayer::CreateForMailbox( | 210 layer_ = cc::TextureLayer::CreateForMailbox(this); |
| 212 cc::LayerSettings(), this); | |
| 213 web_layer_ = make_scoped_ptr(new cc_blink::WebLayerImpl(layer_)); | 211 web_layer_ = make_scoped_ptr(new cc_blink::WebLayerImpl(layer_)); |
| 214 container_ = container; | 212 container_ = container; |
| 215 container_->setWebLayer(web_layer_.get()); | 213 container_->setWebLayer(web_layer_.get()); |
| 216 if (re_request_touch_events_) { | 214 if (re_request_touch_events_) { |
| 217 container_->requestTouchEventType( | 215 container_->requestTouchEventType( |
| 218 blink::WebPluginContainer::TouchEventRequestTypeSynthesizedMouse); | 216 blink::WebPluginContainer::TouchEventRequestTypeSynthesizedMouse); |
| 219 container_->requestTouchEventType( | 217 container_->requestTouchEventType( |
| 220 blink::WebPluginContainer::TouchEventRequestTypeRaw); | 218 blink::WebPluginContainer::TouchEventRequestTypeRaw); |
| 221 } | 219 } |
| 222 container_->requestTouchEventType(touch_event_request_); | 220 container_->requestTouchEventType(touch_event_request_); |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 return kPluginPersistsMimeType; | 758 return kPluginPersistsMimeType; |
| 761 } | 759 } |
| 762 | 760 |
| 763 bool TestPlugin::IsSupportedMimeType(const blink::WebString& mime_type) { | 761 bool TestPlugin::IsSupportedMimeType(const blink::WebString& mime_type) { |
| 764 return mime_type == TestPlugin::MimeType() || | 762 return mime_type == TestPlugin::MimeType() || |
| 765 mime_type == PluginPersistsMimeType() || | 763 mime_type == PluginPersistsMimeType() || |
| 766 mime_type == CanCreateWithoutRendererMimeType(); | 764 mime_type == CanCreateWithoutRendererMimeType(); |
| 767 } | 765 } |
| 768 | 766 |
| 769 } // namespace test_runner | 767 } // namespace test_runner |
| OLD | NEW |