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

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

Issue 383463002: Don't bother asking the platform for the delegates if they are already set (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | « no previous file | no next file » | 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 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(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698