| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| 11 #include <map> | 11 #include <map> |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // Invoked to show the context menu for the source view. If is_mouse_gesture | 61 // Invoked to show the context menu for the source view. If is_mouse_gesture |
| 62 // is true, the x/y coordinate are the location of the mouse. If | 62 // is true, the x/y coordinate are the location of the mouse. If |
| 63 // is_mouse_gesture is false, this method was not invoked by a mouse gesture | 63 // is_mouse_gesture is false, this method was not invoked by a mouse gesture |
| 64 // and x/y is the recommended location to show the menu at. | 64 // and x/y is the recommended location to show the menu at. |
| 65 // | 65 // |
| 66 // x/y is in screen coordinates. | 66 // x/y is in screen coordinates. |
| 67 virtual void ShowContextMenu(View* source, | 67 virtual void ShowContextMenu(View* source, |
| 68 int x, | 68 int x, |
| 69 int y, | 69 int y, |
| 70 bool is_mouse_gesture) = 0; | 70 bool is_mouse_gesture) = 0; |
| 71 | |
| 72 protected: | |
| 73 ~ContextMenuController() {} | |
| 74 }; | 71 }; |
| 75 | 72 |
| 76 // DragController is responsible for writing drag data for a view, as well as | 73 // DragController is responsible for writing drag data for a view, as well as |
| 77 // supplying the supported drag operations. Use DragController if you don't | 74 // supplying the supported drag operations. Use DragController if you don't |
| 78 // want to subclass. | 75 // want to subclass. |
| 79 | 76 |
| 80 class DragController { | 77 class DragController { |
| 81 public: | 78 public: |
| 82 // Writes the data for the drag. | 79 // Writes the data for the drag. |
| 83 virtual void WriteDragData(View* sender, | 80 virtual void WriteDragData(View* sender, |
| 84 int press_x, | 81 int press_x, |
| 85 int press_y, | 82 int press_y, |
| 86 OSExchangeData* data) = 0; | 83 OSExchangeData* data) = 0; |
| 87 | 84 |
| 88 // Returns the supported drag operations (see DragDropTypes for possible | 85 // Returns the supported drag operations (see DragDropTypes for possible |
| 89 // values). A drag is only started if this returns a non-zero value. | 86 // values). A drag is only started if this returns a non-zero value. |
| 90 virtual int GetDragOperations(View* sender, int x, int y) = 0; | 87 virtual int GetDragOperations(View* sender, int x, int y) = 0; |
| 91 | |
| 92 protected: | |
| 93 ~DragController() {} | |
| 94 }; | 88 }; |
| 95 | 89 |
| 96 | 90 |
| 97 ///////////////////////////////////////////////////////////////////////////// | 91 ///////////////////////////////////////////////////////////////////////////// |
| 98 // | 92 // |
| 99 // View class | 93 // View class |
| 100 // | 94 // |
| 101 // A View is a rectangle within the views View hierarchy. It is the base | 95 // A View is a rectangle within the views View hierarchy. It is the base |
| 102 // class for all Views. | 96 // class for all Views. |
| 103 // | 97 // |
| (...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1231 // is going to be flipped horizontally (using the appropriate transform) on | 1225 // is going to be flipped horizontally (using the appropriate transform) on |
| 1232 // right-to-left locales for this View. | 1226 // right-to-left locales for this View. |
| 1233 bool flip_canvas_on_paint_for_rtl_ui_; | 1227 bool flip_canvas_on_paint_for_rtl_ui_; |
| 1234 | 1228 |
| 1235 DISALLOW_COPY_AND_ASSIGN(View); | 1229 DISALLOW_COPY_AND_ASSIGN(View); |
| 1236 }; | 1230 }; |
| 1237 | 1231 |
| 1238 } // namespace views | 1232 } // namespace views |
| 1239 | 1233 |
| 1240 #endif // VIEWS_VIEW_H_ | 1234 #endif // VIEWS_VIEW_H_ |
| OLD | NEW |