OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/touchui/touch_factory.h" | 5 #include "views/touchui/touch_factory.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 #include <gdk/gdkx.h> | 8 #include <gdk/gdkx.h> |
9 #include <X11/cursorfont.h> | 9 #include <X11/cursorfont.h> |
10 #include <X11/extensions/XInput.h> | 10 #include <X11/extensions/XInput.h> |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 | 344 |
345 void TouchFactory::SetCursorVisible(bool show, bool start_timer) { | 345 void TouchFactory::SetCursorVisible(bool show, bool start_timer) { |
346 #if defined(TOUCH_UI) | 346 #if defined(TOUCH_UI) |
347 if (!base::MessagePumpForUI::HasXInput2()) | 347 if (!base::MessagePumpForUI::HasXInput2()) |
348 return; | 348 return; |
349 #endif | 349 #endif |
350 | 350 |
351 // The cursor is going to be shown. Reset the timer for hiding it. | 351 // The cursor is going to be shown. Reset the timer for hiding it. |
352 if (show && start_timer) { | 352 if (show && start_timer) { |
353 cursor_timer_.Stop(); | 353 cursor_timer_.Stop(); |
354 cursor_timer_.Start(base::TimeDelta::FromSeconds(kCursorIdleSeconds), | 354 cursor_timer_.Start( |
| 355 FROM_HERE, base::TimeDelta::FromSeconds(kCursorIdleSeconds), |
355 this, &TouchFactory::HideCursorForInactivity); | 356 this, &TouchFactory::HideCursorForInactivity); |
356 } else { | 357 } else { |
357 cursor_timer_.Stop(); | 358 cursor_timer_.Stop(); |
358 } | 359 } |
359 | 360 |
360 if (show == is_cursor_visible_) | 361 if (show == is_cursor_visible_) |
361 return; | 362 return; |
362 | 363 |
363 is_cursor_visible_ = show; | 364 is_cursor_visible_ = show; |
364 | 365 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 float* max) { | 437 float* max) { |
437 if (valuator_lookup_[deviceid][tp] >= 0) { | 438 if (valuator_lookup_[deviceid][tp] >= 0) { |
438 *min = touch_param_min_[deviceid][tp]; | 439 *min = touch_param_min_[deviceid][tp]; |
439 *max = touch_param_max_[deviceid][tp]; | 440 *max = touch_param_max_[deviceid][tp]; |
440 return true; | 441 return true; |
441 } | 442 } |
442 return false; | 443 return false; |
443 } | 444 } |
444 | 445 |
445 } // namespace views | 446 } // namespace views |
OLD | NEW |