Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1913)

Unified Diff: content/public/browser/screen_orientation_provider.h

Issue 546453004: Centralize ScreenOrientationProvider logic, add platform delegates (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@screen_orientation_public_impl_split
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698