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

Side by Side Diff: ui/display/chromeos/display_configurator.cc

Issue 508303002: Move touchscreen device caching to DeviceDataManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove PlatformEventObserver Created 6 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/display/chromeos/display_configurator.h" 5 #include "ui/display/chromeos/display_configurator.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
11 #include "base/strings/stringprintf.h" 11 #include "base/strings/stringprintf.h"
12 #include "base/sys_info.h" 12 #include "base/sys_info.h"
13 #include "base/time/time.h" 13 #include "base/time/time.h"
14 #include "ui/display/chromeos/touchscreen_delegate_impl.h"
14 #include "ui/display/display_switches.h" 15 #include "ui/display/display_switches.h"
15 #include "ui/display/types/chromeos/display_mode.h" 16 #include "ui/display/types/chromeos/display_mode.h"
16 #include "ui/display/types/chromeos/display_snapshot.h" 17 #include "ui/display/types/chromeos/display_snapshot.h"
17 #include "ui/display/types/chromeos/native_display_delegate.h" 18 #include "ui/display/types/chromeos/native_display_delegate.h"
18 19
19 namespace ui { 20 namespace ui {
20 21
21 namespace { 22 namespace {
22 23
23 typedef std::vector<const DisplayMode*> DisplayModeList; 24 typedef std::vector<const DisplayMode*> DisplayModeList;
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 return; 193 return;
193 194
194 // If the delegates are already initialized don't update them (For example, 195 // If the delegates are already initialized don't update them (For example,
195 // tests set their own delegates). 196 // tests set their own delegates).
196 if (!native_display_delegate_) { 197 if (!native_display_delegate_) {
197 native_display_delegate_ = CreatePlatformNativeDisplayDelegate(); 198 native_display_delegate_ = CreatePlatformNativeDisplayDelegate();
198 native_display_delegate_->AddObserver(this); 199 native_display_delegate_->AddObserver(this);
199 } 200 }
200 201
201 if (!touchscreen_delegate_) 202 if (!touchscreen_delegate_)
202 touchscreen_delegate_ = CreatePlatformTouchscreenDelegate(); 203 touchscreen_delegate_.reset(new TouchscreenDelegateImpl());
203 } 204 }
204 205
205 void DisplayConfigurator::ForceInitialConfigure( 206 void DisplayConfigurator::ForceInitialConfigure(
206 uint32_t background_color_argb) { 207 uint32_t background_color_argb) {
207 if (!configure_display_) 208 if (!configure_display_)
208 return; 209 return;
209 210
210 native_display_delegate_->GrabServer(); 211 native_display_delegate_->GrabServer();
211 native_display_delegate_->Initialize(); 212 native_display_delegate_->Initialize();
212 213
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 return state_controller_->GetStateForDisplayIds(display_ids); 959 return state_controller_->GetStateForDisplayIds(display_ids);
959 } 960 }
960 } 961 }
961 default: 962 default:
962 NOTREACHED(); 963 NOTREACHED();
963 } 964 }
964 return MULTIPLE_DISPLAY_STATE_INVALID; 965 return MULTIPLE_DISPLAY_STATE_INVALID;
965 } 966 }
966 967
967 } // namespace ui 968 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698