OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BROWSER_DEVICE_ORIENTATION_PROVIDER_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_DEVICE_ORIENTATION_PROVIDER_IMPL_H_ |
6 #define CONTENT_BROWSER_DEVICE_ORIENTATION_PROVIDER_IMPL_H_ | 6 #define CONTENT_BROWSER_DEVICE_ORIENTATION_PROVIDER_IMPL_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 class ProviderImpl : public Provider { | 26 class ProviderImpl : public Provider { |
27 public: | 27 public: |
28 typedef DataFetcher* (*DataFetcherFactory)(); | 28 typedef DataFetcher* (*DataFetcherFactory)(); |
29 | 29 |
30 // Create a ProviderImpl that uses the NULL-terminated factories array to find | 30 // Create a ProviderImpl that uses the NULL-terminated factories array to find |
31 // a DataFetcher that can provide orientation data. | 31 // a DataFetcher that can provide orientation data. |
32 CONTENT_EXPORT ProviderImpl(const DataFetcherFactory factories[]); | 32 CONTENT_EXPORT ProviderImpl(const DataFetcherFactory factories[]); |
33 | 33 |
34 // From Provider. | 34 // From Provider. |
35 virtual void AddObserver(Observer* observer); | 35 virtual void AddObserver(Observer* observer) OVERRIDE; |
36 virtual void RemoveObserver(Observer* observer); | 36 virtual void RemoveObserver(Observer* observer) OVERRIDE; |
37 | 37 |
38 private: | 38 private: |
39 virtual ~ProviderImpl(); | 39 virtual ~ProviderImpl(); |
40 | 40 |
41 // Starts or Stops the provider. Called from creator_loop_. | 41 // Starts or Stops the provider. Called from creator_loop_. |
42 void Start(); | 42 void Start(); |
43 void Stop(); | 43 void Stop(); |
44 | 44 |
45 // Method for finding a suitable DataFetcher and starting the polling. | 45 // Method for finding a suitable DataFetcher and starting the polling. |
46 // Runs on the polling_thread_. | 46 // Runs on the polling_thread_. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 Orientation last_orientation_; | 78 Orientation last_orientation_; |
79 base::WeakPtrFactory<ProviderImpl> weak_factory_; | 79 base::WeakPtrFactory<ProviderImpl> weak_factory_; |
80 | 80 |
81 // Polling is done on this background thread. | 81 // Polling is done on this background thread. |
82 scoped_ptr<base::Thread> polling_thread_; | 82 scoped_ptr<base::Thread> polling_thread_; |
83 }; | 83 }; |
84 | 84 |
85 } // namespace device_orientation | 85 } // namespace device_orientation |
86 | 86 |
87 #endif // CONTENT_BROWSER_DEVICE_ORIENTATION_PROVIDER_IMPL_H_ | 87 #endif // CONTENT_BROWSER_DEVICE_ORIENTATION_PROVIDER_IMPL_H_ |
OLD | NEW |