OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CONTENT_CHILD_WEBFALLBACKTHEMEENGINE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_HOST_H_ |
6 #define CONTENT_CHILD_WEBFALLBACKTHEMEENGINE_IMPL_H_ | 6 #define CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_HOST_H_ |
| 7 |
| 8 #include <vector> |
7 | 9 |
8 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
9 #include "third_party/WebKit/public/platform/WebFallbackThemeEngine.h" | |
10 | |
11 namespace ui { | |
12 class FallbackTheme; | |
13 } | |
14 | 11 |
15 namespace content { | 12 namespace content { |
| 13 class SharedWorkerMessageFilter; |
| 14 class SharedWorkerInstance; |
16 | 15 |
17 class WebFallbackThemeEngineImpl : public blink::WebFallbackThemeEngine { | 16 // The SharedWorkerHost is the interface that represents the browser side of |
| 17 // the browser <-> worker communication channel. |
| 18 class SharedWorkerHost { |
18 public: | 19 public: |
19 WebFallbackThemeEngineImpl(); | 20 explicit SharedWorkerHost(SharedWorkerInstance* instance); |
20 virtual ~WebFallbackThemeEngineImpl(); | 21 ~SharedWorkerHost(); |
21 | 22 |
22 // WebFallbackThemeEngine methods: | 23 // Starts the SharedWorker in the renderer process which is associated with |
23 virtual blink::WebSize getSize(blink::WebFallbackThemeEngine::Part); | 24 // |filter|. |
24 virtual void paint( | 25 void Init(SharedWorkerMessageFilter* filter); |
25 blink::WebCanvas* canvas, | 26 |
26 blink::WebFallbackThemeEngine::Part part, | 27 SharedWorkerInstance* instance() { return instance_.get(); } |
27 blink::WebFallbackThemeEngine::State state, | 28 int worker_route_id() const { return worker_route_id_; } |
28 const blink::WebRect& rect, | |
29 const blink::WebFallbackThemeEngine::ExtraParams* extra_params); | |
30 | 29 |
31 private: | 30 private: |
32 scoped_ptr<ui::FallbackTheme> theme_; | 31 scoped_ptr<SharedWorkerInstance> instance_; |
| 32 int worker_route_id_; |
33 | 33 |
34 DISALLOW_COPY_AND_ASSIGN(WebFallbackThemeEngineImpl); | 34 DISALLOW_COPY_AND_ASSIGN(SharedWorkerHost); |
35 }; | 35 }; |
36 | |
37 } // namespace content | 36 } // namespace content |
38 | 37 |
39 #endif // CONTENT_CHILD_WEBFALLBACKTHEMEENGINE_IMPL_H_ | 38 #endif // CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_HOST_H_ |
OLD | NEW |