Chromium Code Reviews| Index: content/public/browser/screen_orientation_provider.h |
| diff --git a/content/public/browser/screen_orientation_provider.h b/content/public/browser/screen_orientation_provider.h |
| index c94fbe7239219326d1810b7cc4bc8d095bfd1fda..c07071594f4ca481537639b26973360118261f00 100644 |
| --- a/content/public/browser/screen_orientation_provider.h |
| +++ b/content/public/browser/screen_orientation_provider.h |
| @@ -12,6 +12,7 @@ |
| namespace content { |
| class ScreenOrientationDispatcherHost; |
| +class ScreenOrientationProviderFactory; |
| class WebContents; |
| // Interface that needs to be implemented by any backend that wants to handle |
| @@ -32,27 +33,28 @@ class CONTENT_EXPORT ScreenOrientationProvider { |
| virtual ~ScreenOrientationProvider() {} |
| - protected: |
| - friend class ScreenOrientationDispatcherHostImpl; |
| - |
| + // Creates a ScreenOrientationProvider for a ScreenOrientationDispatcherHost |
| + // to notify. SetFactory can be used to override. |
| static ScreenOrientationProvider* Create( |
|
mlamouri (slow - plz ping)
2014/09/16 20:21:04
Should that be an own ptr?
jonross
2014/09/16 21:48:13
Doing a code search for 'own ptr' points me to wtf
mlamouri (slow - plz ping)
2014/09/16 22:00:45
Sorry about that. I got confused with WebKit indee
|
| ScreenOrientationDispatcherHost* dispatcher_host, |
| WebContents* web_contents); |
| + // Provide a factory to override the creation in Create(). The factory is not |
| + // owned by ScreenOrientationProvider. |
| + static void SetFactory(ScreenOrientationProviderFactory* factory); |
| + |
| + protected: |
| + friend class ScreenOrientationDispatcherHostImpl; |
| + |
| ScreenOrientationProvider() {} |
| + private: |
| + // Not owned, overrides behaviour in Create(). |
| + static ScreenOrientationProviderFactory* factory_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(ScreenOrientationProvider); |
| }; |
| -#if !defined(OS_ANDROID) |
| -// static |
| -ScreenOrientationProvider* ScreenOrientationProvider::Create( |
| - ScreenOrientationDispatcherHost* dispatcher_host, |
| - WebContents* web_contents) { |
| - return NULL; |
| -} |
| -#endif // !defined(OS_ANDROID) |
| - |
| } // namespace content |
| #endif // CONTENT_PUBLIC_BROWSER_SCREEN_ORIENTATION_PROVIDER_H_ |