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

Unified Diff: ui/display/chromeos/display_configurator.cc

Issue 230763004: Split ui/display types into separate module and have Ozone depend on it (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 6 years, 8 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
« no previous file with comments | « ui/display/chromeos/display_configurator.h ('k') | ui/display/chromeos/display_configurator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/chromeos/display_configurator.cc
diff --git a/ui/display/chromeos/display_configurator.cc b/ui/display/chromeos/display_configurator.cc
index 8a8885a5e032041822c77df907b9f93e19ef5afb..1283b58a2b108b1180e020e83abc1169055d3e35 100644
--- a/ui/display/chromeos/display_configurator.cc
+++ b/ui/display/chromeos/display_configurator.cc
@@ -11,18 +11,10 @@
#include "base/strings/stringprintf.h"
#include "base/sys_info.h"
#include "base/time/time.h"
-#include "ui/display/chromeos/display_mode.h"
-#include "ui/display/chromeos/display_snapshot.h"
-#include "ui/display/chromeos/native_display_delegate.h"
#include "ui/display/display_switches.h"
-
-#if defined(USE_OZONE)
-#include "ui/display/chromeos/ozone/native_display_delegate_ozone.h"
-#include "ui/display/chromeos/ozone/touchscreen_delegate_ozone.h"
-#elif defined(USE_X11)
-#include "ui/display/chromeos/x11/native_display_delegate_x11.h"
-#include "ui/display/chromeos/x11/touchscreen_delegate_x11.h"
-#endif
+#include "ui/display/types/chromeos/display_mode.h"
+#include "ui/display/types/chromeos/display_snapshot.h"
+#include "ui/display/types/chromeos/native_display_delegate.h"
namespace ui {
@@ -172,20 +164,14 @@ DisplayConfigurator::~DisplayConfigurator() {
native_display_delegate_->RemoveObserver(this);
}
-void DisplayConfigurator::SetNativeDisplayDelegateForTesting(
- scoped_ptr<NativeDisplayDelegate> delegate) {
+void DisplayConfigurator::SetDelegatesForTesting(
+ scoped_ptr<NativeDisplayDelegate> display_delegate,
+ scoped_ptr<TouchscreenDelegate> touchscreen_delegate) {
DCHECK(!native_display_delegate_);
-
- native_display_delegate_ = delegate.Pass();
- native_display_delegate_->AddObserver(this);
- configure_display_ = true;
-}
-
-void DisplayConfigurator::SetTouchscreenDelegateForTesting(
- scoped_ptr<TouchscreenDelegate> delegate) {
DCHECK(!touchscreen_delegate_);
- touchscreen_delegate_ = delegate.Pass();
+ InitializeDelegates(display_delegate.Pass(), touchscreen_delegate.Pass());
+ configure_display_ = true;
}
void DisplayConfigurator::SetInitialDisplayPower(
@@ -199,25 +185,17 @@ void DisplayConfigurator::Init(bool is_panel_fitting_enabled) {
if (!configure_display_)
return;
- if (!native_display_delegate_) {
-#if defined(USE_OZONE)
- native_display_delegate_.reset(new NativeDisplayDelegateOzone());
-#elif defined(USE_X11)
- native_display_delegate_.reset(new NativeDisplayDelegateX11());
-#else
- NOTREACHED();
-#endif
- native_display_delegate_->AddObserver(this);
- }
+ PlatformInitialize();
+}
- if (!touchscreen_delegate_) {
-#if defined(USE_OZONE)
- touchscreen_delegate_.reset(new TouchscreenDelegateOzone());
-#elif defined(USE_X11)
- touchscreen_delegate_.reset(new TouchscreenDelegateX11());
-#else
- NOTREACHED();
-#endif
+void DisplayConfigurator::InitializeDelegates(
+ scoped_ptr<NativeDisplayDelegate> display_delegate,
+ scoped_ptr<TouchscreenDelegate> touchscreen_delegate) {
+ if (!native_display_delegate_ && !touchscreen_delegate_) {
+ native_display_delegate_ = display_delegate.Pass();
+ touchscreen_delegate_ = touchscreen_delegate.Pass();
+
+ native_display_delegate_->AddObserver(this);
}
}
« no previous file with comments | « ui/display/chromeos/display_configurator.h ('k') | ui/display/chromeos/display_configurator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698