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

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

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.cc
diff --git a/content/public/browser/screen_orientation_provider.cc b/content/public/browser/screen_orientation_provider.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7f452ca664fb5c9c92bf28d689317eb502d70de4
--- /dev/null
+++ b/content/public/browser/screen_orientation_provider.cc
@@ -0,0 +1,27 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/public/browser/screen_orientation_provider.h"
+
+#include "content/public/browser/screen_orientation_provider_factory.h"
+
+namespace content {
+
+ScreenOrientationProviderFactory* ScreenOrientationProvider::factory_ = NULL;
+
+ScreenOrientationProvider*
+ ScreenOrientationProvider::ScreenOrientationProvider::Create(
mlamouri (slow - plz ping) 2014/09/16 20:21:04 isn't there one ScreenOrientationProvider too many
jonross 2014/09/16 21:48:13 Yeah... not sure why it didn't complain
+ ScreenOrientationDispatcherHost* dispatcher_host,
+ WebContents* web_contents) {
+ if (factory_)
+ return factory_->Create(dispatcher_host, web_contents);
+ return NULL;
mlamouri (slow - plz ping) 2014/09/16 20:21:04 nit: I would do: if (!factory_) return NULL; ret
jonross 2014/09/16 21:48:13 Done.
+}
+
+void ScreenOrientationProvider::SetFactory(
+ ScreenOrientationProviderFactory* factory) {
+ factory_ = factory;
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698