diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-20 16:57:50 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-20 16:57:50 +0000 |
commit | d894aa438f57fcd48a6ca38a6102f81ac544549e (patch) | |
tree | 56ad3ca0d17d3f3ce579602d342b9f42d866273a /views | |
parent | 293f70cbc7f8692254176f47d39f590fac1c2c4e (diff) | |
download | chromium_src-d894aa438f57fcd48a6ca38a6102f81ac544549e.zip chromium_src-d894aa438f57fcd48a6ca38a6102f81ac544549e.tar.gz chromium_src-d894aa438f57fcd48a6ca38a6102f81ac544549e.tar.bz2 |
Fix touch build after hiding RootView.
BUG=none
TEST=compiles with touchui
Review URL: http://codereview.chromium.org/6961020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86094 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/focus/accelerator_handler_touch.cc | 1 | ||||
-rw-r--r-- | views/touchui/touch_factory.cc | 1 | ||||
-rw-r--r-- | views/touchui/touch_factory.h | 7 | ||||
-rw-r--r-- | views/widget/native_widget_gtk.cc | 2 | ||||
-rw-r--r-- | views/widget/root_view.cc | 16 | ||||
-rw-r--r-- | views/widget/root_view.h | 5 |
6 files changed, 10 insertions, 22 deletions
diff --git a/views/focus/accelerator_handler_touch.cc b/views/focus/accelerator_handler_touch.cc index 91e981a..23862d4 100644 --- a/views/focus/accelerator_handler_touch.cc +++ b/views/focus/accelerator_handler_touch.cc @@ -17,6 +17,7 @@ #include "views/focus/focus_manager.h" #include "views/ime/input_method.h" #include "views/touchui/touch_factory.h" +#include "views/view.h" #include "views/widget/native_widget.h" namespace views { diff --git a/views/touchui/touch_factory.cc b/views/touchui/touch_factory.cc index 3bf0273..17542ad 100644 --- a/views/touchui/touch_factory.cc +++ b/views/touchui/touch_factory.cc @@ -122,6 +122,7 @@ TouchFactory* TouchFactory::GetInstance() { TouchFactory::TouchFactory() : is_cursor_visible_(true), + keep_mouse_cursor_(false), cursor_timer_(), pointer_device_lookup_(), touch_device_list_(), diff --git a/views/touchui/touch_factory.h b/views/touchui/touch_factory.h index e16879d..9929483 100644 --- a/views/touchui/touch_factory.h +++ b/views/touchui/touch_factory.h @@ -98,6 +98,9 @@ class TouchFactory { // is not found. bool ExtractTouchParam(const XEvent& xev, TouchParam tp, float* value); + void set_keep_mouse_cursor(bool keep) { keep_mouse_cursor_ = keep; } + bool keep_mouse_cursor() const { return keep_mouse_cursor_; } + private: TouchFactory(); @@ -119,6 +122,10 @@ class TouchFactory { // is immediately displayed. bool is_cursor_visible_; + // Whether to turn off automatic hiding of mouse cursor. This is useful for + // debugging touch build on the desktop. + bool keep_mouse_cursor_; + // The cursor is hidden if it is idle for a certain amount time. This timer // is used to keep track of the idleness. base::OneShotTimer<TouchFactory> cursor_timer_; diff --git a/views/widget/native_widget_gtk.cc b/views/widget/native_widget_gtk.cc index 0aeb451..ba3364c 100644 --- a/views/widget/native_widget_gtk.cc +++ b/views/widget/native_widget_gtk.cc @@ -1015,7 +1015,7 @@ void NativeWidgetGtk::SchedulePaintInRect(const gfx::Rect& rect) { void NativeWidgetGtk::SetCursor(gfx::NativeCursor cursor) { #if defined(TOUCH_UI) && defined(HAVE_XINPUT2) if (!TouchFactory::GetInstance()->is_cursor_visible() && - !RootView::GetKeepMouseCursor()) + !TouchFactory::GetInstance()->keep_mouse_cursor()) cursor = gfx::GetCursor(GDK_BLANK_CURSOR); #endif // |window_contents_| is placed on top of |widget_|. So the cursor needs to be diff --git a/views/widget/root_view.cc b/views/widget/root_view.cc index 9537bd8..0b64f4e 100644 --- a/views/widget/root_view.cc +++ b/views/widget/root_view.cc @@ -400,22 +400,6 @@ void RootView::GetAccessibleState(ui::AccessibleViewState* state) { state->role = ui::AccessibilityTypes::ROLE_APPLICATION; } -#if defined(TOUCH_UI) -namespace { -// Always show the mouse cursor, useful when debugging touch builds -bool keep_mouse_cursor; -} - -void RootView::SetKeepMouseCursor(bool keep) { - keep_mouse_cursor = keep; -} - -bool RootView::GetKeepMouseCursor() { - return keep_mouse_cursor; -} - -#endif - //////////////////////////////////////////////////////////////////////////////// // RootView, protected: diff --git a/views/widget/root_view.h b/views/widget/root_view.h index 587967f..18b08f8 100644 --- a/views/widget/root_view.h +++ b/views/widget/root_view.h @@ -115,11 +115,6 @@ class RootView : public View, virtual void SetMouseHandler(View* new_mouse_handler) OVERRIDE; virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; -#if defined(TOUCH_UI) - static void SetKeepMouseCursor(bool keep); - static bool GetKeepMouseCursor(); -#endif - protected: // Overridden from View: virtual void ViewHierarchyChanged(bool is_add, View* parent, |