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

Side by Side Diff: views/view.h

Issue 3192002: Added entry points to view/View to dispatch and process TouchEvents. (Closed) Base URL: git://codf21.jail.google.com/chromium.git
Patch Set: final changes Created 10 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
« no previous file with comments | « views/touchui/gesture_manager.cc ('k') | views/view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #ifndef VIEWS_VIEW_H_ 5 #ifndef VIEWS_VIEW_H_
6 #define VIEWS_VIEW_H_ 6 #define VIEWS_VIEW_H_
7 #pragma once 7 #pragma once
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 10
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 // This method is invoked when the mouse enters this control. 698 // This method is invoked when the mouse enters this control.
699 // 699 //
700 // Default implementation does nothing. Override as needed. 700 // Default implementation does nothing. Override as needed.
701 virtual void OnMouseEntered(const MouseEvent& event); 701 virtual void OnMouseEntered(const MouseEvent& event);
702 702
703 // This method is invoked when the mouse exits this control 703 // This method is invoked when the mouse exits this control
704 // The provided event location is always (0, 0) 704 // The provided event location is always (0, 0)
705 // Default implementation does nothing. Override as needed. 705 // Default implementation does nothing. Override as needed.
706 virtual void OnMouseExited(const MouseEvent& event); 706 virtual void OnMouseExited(const MouseEvent& event);
707 707
708 #if defined(TOUCH_UI)
709 // This method is invoked for each touch event. Default implementation
710 // does nothing. Override as needed.
711 virtual bool OnTouchEvent(const TouchEvent& event);
712 #endif
713
708 // Set the MouseHandler for a drag session. 714 // Set the MouseHandler for a drag session.
709 // 715 //
710 // A drag session is a stream of mouse events starting 716 // A drag session is a stream of mouse events starting
711 // with a MousePressed event, followed by several MouseDragged 717 // with a MousePressed event, followed by several MouseDragged
712 // events and finishing with a MouseReleased event. 718 // events and finishing with a MouseReleased event.
713 // 719 //
714 // This method should be only invoked while processing a 720 // This method should be only invoked while processing a
715 // MouseDragged or MouseReleased event. 721 // MouseDragged or MousePressed event.
716 // 722 //
717 // All further mouse dragged and mouse up events will be sent 723 // All further mouse dragged and mouse up events will be sent
718 // the MouseHandler, even if it is reparented to another window. 724 // the MouseHandler, even if it is reparented to another window.
719 // 725 //
720 // The MouseHandler is automatically cleared when the control 726 // The MouseHandler is automatically cleared when the control
721 // comes back from processing the MouseReleased event. 727 // comes back from processing the MouseReleased event.
722 // 728 //
723 // Note: if the mouse handler is no longer connected to a 729 // Note: if the mouse handler is no longer connected to a
724 // view hierarchy, events won't be sent. 730 // view hierarchy, events won't be sent.
725 // 731 //
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
1153 // Used to propagate locale changed notifications from the root view to all 1159 // Used to propagate locale changed notifications from the root view to all
1154 // views in the hierarchy. 1160 // views in the hierarchy.
1155 virtual void PropagateLocaleChanged(); 1161 virtual void PropagateLocaleChanged();
1156 1162
1157 // RootView invokes these. These in turn invoke the appropriate OnMouseXXX 1163 // RootView invokes these. These in turn invoke the appropriate OnMouseXXX
1158 // method. If a drag is detected, DoDrag is invoked. 1164 // method. If a drag is detected, DoDrag is invoked.
1159 bool ProcessMousePressed(const MouseEvent& e, DragInfo* drop_info); 1165 bool ProcessMousePressed(const MouseEvent& e, DragInfo* drop_info);
1160 bool ProcessMouseDragged(const MouseEvent& e, DragInfo* drop_info); 1166 bool ProcessMouseDragged(const MouseEvent& e, DragInfo* drop_info);
1161 void ProcessMouseReleased(const MouseEvent& e, bool canceled); 1167 void ProcessMouseReleased(const MouseEvent& e, bool canceled);
1162 1168
1169 #if defined(TOUCH_UI)
1170 // RootView will invoke this with incoming TouchEvents. Returns the
1171 // the result of OnTouchEvent: true if the event was handled by the
1172 // callee.
1173 bool ProcessTouchEvent(const TouchEvent& e);
1174 #endif
1175
1163 // Starts a drag and drop operation originating from this view. This invokes 1176 // Starts a drag and drop operation originating from this view. This invokes
1164 // WriteDragData to write the data and GetDragOperations to determine the 1177 // WriteDragData to write the data and GetDragOperations to determine the
1165 // supported drag operations. When done, OnDragDone is invoked. 1178 // supported drag operations. When done, OnDragDone is invoked.
1166 void DoDrag(const MouseEvent& e, const gfx::Point& press_pt); 1179 void DoDrag(const MouseEvent& e, const gfx::Point& press_pt);
1167 1180
1168 // Removes |view| from the hierarchy tree. If |update_focus_cycle| is true, 1181 // Removes |view| from the hierarchy tree. If |update_focus_cycle| is true,
1169 // the next and previous focusable views of views pointing to this view are 1182 // the next and previous focusable views of views pointing to this view are
1170 // updated. If |update_tool_tip| is true, the tooltip is updated. If 1183 // updated. If |update_tool_tip| is true, the tooltip is updated. If
1171 // |delete_removed_view| is true, the view is also deleted (if it is parent 1184 // |delete_removed_view| is true, the view is also deleted (if it is parent
1172 // owned). 1185 // owned).
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1328 // The default value for how long to wait (in ms) before showing a menu 1341 // The default value for how long to wait (in ms) before showing a menu
1329 // button on hover. This value is used if the OS doesn't supply one. 1342 // button on hover. This value is used if the OS doesn't supply one.
1330 static const int kShowFolderDropMenuDelay; 1343 static const int kShowFolderDropMenuDelay;
1331 1344
1332 DISALLOW_COPY_AND_ASSIGN(View); 1345 DISALLOW_COPY_AND_ASSIGN(View);
1333 }; 1346 };
1334 1347
1335 } // namespace views 1348 } // namespace views
1336 1349
1337 #endif // VIEWS_VIEW_H_ 1350 #endif // VIEWS_VIEW_H_
OLDNEW
« no previous file with comments | « views/touchui/gesture_manager.cc ('k') | views/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698