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

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 | « ui/display/chromeos/display_configurator.h ('k') | ui/display/chromeos/ozone/display_configurator_ozone.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 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);
}
« no previous file with comments | « ui/display/chromeos/display_configurator.h ('k') | ui/display/chromeos/ozone/display_configurator_ozone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698