Index: ui/display/chromeos/display_configurator.cc |
diff --git a/ui/display/chromeos/display_configurator.cc b/ui/display/chromeos/display_configurator.cc |
index cfebc8df35f114504d1935f9104fb7482e4cf92a..390d92d35756199d773cf33511c67c6186150668 100644 |
--- a/ui/display/chromeos/display_configurator.cc |
+++ b/ui/display/chromeos/display_configurator.cc |
@@ -164,7 +164,8 @@ void DisplayConfigurator::SetDelegatesForTesting( |
DCHECK(!native_display_delegate_); |
DCHECK(!touchscreen_delegate_); |
- InitializeDelegates(display_delegate.Pass(), touchscreen_delegate.Pass()); |
+ native_display_delegate_ = display_delegate.Pass(); |
+ touchscreen_delegate_ = touchscreen_delegate.Pass(); |
configure_display_ = true; |
} |
@@ -179,15 +180,11 @@ void DisplayConfigurator::Init(bool is_panel_fitting_enabled) { |
if (!configure_display_) |
return; |
- PlatformInitialize(); |
-} |
- |
-void DisplayConfigurator::InitializeDelegates( |
- scoped_ptr<NativeDisplayDelegate> display_delegate, |
- scoped_ptr<TouchscreenDelegate> touchscreen_delegate) { |
+ // If the delegates are already initialized don't update them (For example, |
+ // tests set their own delegates). |
if (!native_display_delegate_ && !touchscreen_delegate_) { |
- native_display_delegate_ = display_delegate.Pass(); |
- touchscreen_delegate_ = touchscreen_delegate.Pass(); |
+ native_display_delegate_ = CreatePlatformNativeDisplayDelegate(); |
Daniel Erat
2014/07/09 21:17:23
nit: probably safer to do this now:
if (!native
dnicoara
2014/07/09 21:21:50
Done.
|
+ touchscreen_delegate_ = CreatePlatformTouchscreenDelegate(); |
native_display_delegate_->AddObserver(this); |
} |