| 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 SKY_VIEWER_PLATFORM_PLATFORM_IMPL_H_ | 5 #ifndef SKY_VIEWER_PLATFORM_PLATFORM_IMPL_H_ |
| 6 #define SKY_VIEWER_PLATFORM_PLATFORM_IMPL_H_ | 6 #define SKY_VIEWER_PLATFORM_PLATFORM_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/threading/thread_local_storage.h" | 10 #include "base/threading/thread_local_storage.h" |
| 11 #include "base/timer/timer.h" | 11 #include "base/timer/timer.h" |
| 12 #include "mojo/services/public/interfaces/network/network_service.mojom.h" | 12 #include "mojo/services/public/interfaces/network/network_service.mojom.h" |
| 13 #include "sky/engine/public/platform/Platform.h" | 13 #include "sky/engine/public/platform/Platform.h" |
| 14 #include "sky/viewer/cc/web_compositor_support_impl.h" | 14 #include "sky/viewer/cc/web_compositor_support_impl.h" |
| 15 #include "sky/viewer/platform/webthemeengine_impl.h" | |
| 16 | 15 |
| 17 namespace mojo { | 16 namespace mojo { |
| 18 class ApplicationImpl; | 17 class ApplicationImpl; |
| 19 } | 18 } |
| 20 | 19 |
| 21 namespace sky { | 20 namespace sky { |
| 22 | 21 |
| 23 class PlatformImpl : public blink::Platform { | 22 class PlatformImpl : public blink::Platform { |
| 24 public: | 23 public: |
| 25 explicit PlatformImpl(mojo::ApplicationImpl* app); | 24 explicit PlatformImpl(mojo::ApplicationImpl* app); |
| 26 virtual ~PlatformImpl(); | 25 virtual ~PlatformImpl(); |
| 27 | 26 |
| 28 // blink::Platform methods: | 27 // blink::Platform methods: |
| 29 virtual blink::WebThemeEngine* themeEngine(); | |
| 30 virtual blink::WebString defaultLocale(); | 28 virtual blink::WebString defaultLocale(); |
| 31 virtual double currentTime(); | 29 virtual double currentTime(); |
| 32 virtual double monotonicallyIncreasingTime(); | 30 virtual double monotonicallyIncreasingTime(); |
| 33 virtual void setSharedTimerFiredFunction(void (*func)()); | 31 virtual void setSharedTimerFiredFunction(void (*func)()); |
| 34 virtual void setSharedTimerFireInterval(double interval_seconds); | 32 virtual void setSharedTimerFireInterval(double interval_seconds); |
| 35 virtual void stopSharedTimer(); | 33 virtual void stopSharedTimer(); |
| 36 virtual base::SingleThreadTaskRunner* mainThreadTaskRunner(); | 34 virtual base::SingleThreadTaskRunner* mainThreadTaskRunner(); |
| 37 virtual bool isThreadedCompositingEnabled(); | 35 virtual bool isThreadedCompositingEnabled(); |
| 38 virtual blink::WebCompositorSupport* compositorSupport(); | 36 virtual blink::WebCompositorSupport* compositorSupport(); |
| 39 virtual mojo::NetworkService* networkService(); | 37 virtual mojo::NetworkService* networkService(); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 79 |
| 82 mojo::NetworkServicePtr network_service_; | 80 mojo::NetworkServicePtr network_service_; |
| 83 base::MessageLoop* main_loop_; | 81 base::MessageLoop* main_loop_; |
| 84 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; | 82 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; |
| 85 base::OneShotTimer<PlatformImpl> shared_timer_; | 83 base::OneShotTimer<PlatformImpl> shared_timer_; |
| 86 void (*shared_timer_func_)(); | 84 void (*shared_timer_func_)(); |
| 87 double shared_timer_fire_time_; | 85 double shared_timer_fire_time_; |
| 88 bool shared_timer_fire_time_was_set_while_suspended_; | 86 bool shared_timer_fire_time_was_set_while_suspended_; |
| 89 int shared_timer_suspended_; // counter | 87 int shared_timer_suspended_; // counter |
| 90 sky_viewer_cc::WebCompositorSupportImpl compositor_support_; | 88 sky_viewer_cc::WebCompositorSupportImpl compositor_support_; |
| 91 WebThemeEngineImpl theme_engine_; | |
| 92 | 89 |
| 93 DISALLOW_COPY_AND_ASSIGN(PlatformImpl); | 90 DISALLOW_COPY_AND_ASSIGN(PlatformImpl); |
| 94 }; | 91 }; |
| 95 | 92 |
| 96 } // namespace sky | 93 } // namespace sky |
| 97 | 94 |
| 98 #endif // SKY_VIEWER_PLATFORM_PLATFORM_IMPL_H_ | 95 #endif // SKY_VIEWER_PLATFORM_PLATFORM_IMPL_H_ |
| OLD | NEW |