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

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

Issue 394063004: Associate internal touchscreen to internal display (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: re-formatting 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
Index: ui/display/chromeos/touchscreen_delegate_impl.cc
diff --git a/ui/display/chromeos/touchscreen_delegate_impl.cc b/ui/display/chromeos/touchscreen_delegate_impl.cc
index 5311a828369183a2c9cf8dfebafffb89cd67ac7f..7721a443428a0c0a067ada32419c0e914273ea2b 100644
--- a/ui/display/chromeos/touchscreen_delegate_impl.cc
+++ b/ui/display/chromeos/touchscreen_delegate_impl.cc
@@ -23,7 +23,38 @@ void TouchscreenDelegateImpl::AssociateTouchscreens(
std::vector<DisplayConfigurator::DisplayState>* displays) {
std::set<int> no_match_touchscreen;
std::vector<TouchscreenDevice> devices = touch_device_manager_->GetDevices();
+
+ int internal_ts = -1;
Daniel Erat 2014/07/16 02:59:46 s/ts/touchscreen/
Yufeng Shen (Slow to review) 2014/07/16 20:20:27 Done.
+ for (size_t i = 0; i < devices.size(); ++i) {
+ if (devices[i].is_internal) {
+ internal_ts = i;
+ break;
+ }
+ }
+
+ DisplayConfigurator::DisplayState* internal_dpy_state = NULL;
Daniel Erat 2014/07/16 02:59:46 s/dpy/display/, or just name this |internal_state|
Yufeng Shen (Slow to review) 2014/07/16 20:20:27 Done.
+ for (size_t i = 0; i < displays->size(); ++i) {
+ DisplayConfigurator::DisplayState* state = &(*displays)[i];
+ if (state->display->type() == DISPLAY_CONNECTION_TYPE_INTERNAL &&
+ state->display->native_mode() &&
+ state->touch_device_id == 0) {
+ internal_dpy_state = state;
+ break;
+ }
+ }
+
+ if (internal_dpy_state && internal_ts >= 0) {
+ internal_dpy_state->touch_device_id = devices[internal_ts].id;
+ VLOG(2) << "Found internal touchscreen for internal display "
+ << internal_dpy_state->display->display_id() << " touch_device_id "
+ << internal_dpy_state->touch_device_id << " size "
+ << devices[internal_ts].size.ToString();
+ }
+
for (size_t i = 0; i < devices.size(); ++i) {
+ if (internal_dpy_state &&
+ internal_dpy_state->touch_device_id == devices[i].id)
+ continue;
bool found_mapping = false;
for (size_t j = 0; j < displays->size(); ++j) {
DisplayConfigurator::DisplayState* state = &(*displays)[j];

Powered by Google App Engine
This is Rietveld 408576698