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..e12e73378ac21600500063b79606c75ce3cba3d8 100644 |
--- a/ui/display/chromeos/display_configurator.cc |
+++ b/ui/display/chromeos/display_configurator.cc |
@@ -179,18 +179,19 @@ void DisplayConfigurator::Init(bool is_panel_fitting_enabled) { |
if (!configure_display_) |
return; |
- PlatformInitialize(); |
+ // If the delegates are already initialized don't update them (For example, |
+ // tests set their own delegates). |
+ if (!native_display_delegate_ && !touchscreen_delegate_) |
+ PlatformInitialize(); |
Daniel Erat
2014/07/09 18:11:24
i'm concerned that someone further down the line w
dnicoara
2014/07/09 19:24:36
Hmm, I don't really want to add too much complexit
|
} |
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_ = display_delegate.Pass(); |
+ touchscreen_delegate_ = touchscreen_delegate.Pass(); |
- native_display_delegate_->AddObserver(this); |
- } |
+ native_display_delegate_->AddObserver(this); |
} |
void DisplayConfigurator::ForceInitialConfigure( |