| 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( | 354 cursor_timer_.Start(base::TimeDelta::FromSeconds(kCursorIdleSeconds), |
| 355 FROM_HERE, base::TimeDelta::FromSeconds(kCursorIdleSeconds), | |
| 356 this, &TouchFactory::HideCursorForInactivity); | 355 this, &TouchFactory::HideCursorForInactivity); |
| 357 } else { | 356 } else { |
| 358 cursor_timer_.Stop(); | 357 cursor_timer_.Stop(); |
| 359 } | 358 } |
| 360 | 359 |
| 361 if (show == is_cursor_visible_) | 360 if (show == is_cursor_visible_) |
| 362 return; | 361 return; |
| 363 | 362 |
| 364 is_cursor_visible_ = show; | 363 is_cursor_visible_ = show; |
| 365 | 364 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 float* max) { | 436 float* max) { |
| 438 if (valuator_lookup_[deviceid][tp] >= 0) { | 437 if (valuator_lookup_[deviceid][tp] >= 0) { |
| 439 *min = touch_param_min_[deviceid][tp]; | 438 *min = touch_param_min_[deviceid][tp]; |
| 440 *max = touch_param_max_[deviceid][tp]; | 439 *max = touch_param_max_[deviceid][tp]; |
| 441 return true; | 440 return true; |
| 442 } | 441 } |
| 443 return false; | 442 return false; |
| 444 } | 443 } |
| 445 | 444 |
| 446 } // namespace views | 445 } // namespace views |
| OLD | NEW |