Chromium Code Reviews| 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 #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 <algorithm> | 9 #include <algorithm> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 166 | 166 |
| 167 // TODO(beng): delete | 167 // TODO(beng): delete |
| 168 // Set whether this view is hottracked. A disabled view cannot be hottracked. | 168 // Set whether this view is hottracked. A disabled view cannot be hottracked. |
| 169 // If flag differs from the current value, SchedulePaint is invoked. | 169 // If flag differs from the current value, SchedulePaint is invoked. |
| 170 virtual void SetHotTracked(bool flag); | 170 virtual void SetHotTracked(bool flag); |
| 171 | 171 |
| 172 // TODO(beng): delete | 172 // TODO(beng): delete |
| 173 // Returns whether the view is hot-tracked. | 173 // Returns whether the view is hot-tracked. |
| 174 virtual bool IsHotTracked() const; | 174 virtual bool IsHotTracked() const; |
| 175 | 175 |
| 176 // FATE TBD ------------------------------------------------------------------ | |
| 177 // TODO(beng): Figure out what these methods are for and delete them. | |
| 178 virtual Widget* GetChildWidget(); | |
| 179 | |
| 180 // Creation and lifetime ----------------------------------------------------- | 176 // Creation and lifetime ----------------------------------------------------- |
| 181 | 177 |
| 182 View(); | 178 View(); |
| 183 virtual ~View(); | 179 virtual ~View(); |
| 184 | 180 |
| 185 // By default a View is owned by its parent unless specified otherwise here. | 181 // By default a View is owned by its parent unless specified otherwise here. |
| 186 bool parent_owned() const { return parent_owned_; } | 182 bool parent_owned() const { return parent_owned_; } |
| 187 void set_parent_owned(bool parent_owned) { parent_owned_ = parent_owned; } | 183 void set_parent_owned(bool parent_owned) { parent_owned_ = parent_owned; } |
| 188 | 184 |
| 189 // Tree operations ----------------------------------------------------------- | 185 // Tree operations ----------------------------------------------------------- |
| (...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 865 | 861 |
| 866 // Returns true if the mouse was dragged enough to start a drag operation. | 862 // Returns true if the mouse was dragged enough to start a drag operation. |
| 867 // delta_x and y are the distance the mouse was dragged. | 863 // delta_x and y are the distance the mouse was dragged. |
| 868 static bool ExceededDragThreshold(int delta_x, int delta_y); | 864 static bool ExceededDragThreshold(int delta_x, int delta_y); |
| 869 | 865 |
| 870 // Accessibility ------------------------------------------------------------- | 866 // Accessibility ------------------------------------------------------------- |
| 871 | 867 |
| 872 // Modifies |state| to reflect the current accessible state of this view. | 868 // Modifies |state| to reflect the current accessible state of this view. |
| 873 virtual void GetAccessibleState(ui::AccessibleViewState* state) { } | 869 virtual void GetAccessibleState(ui::AccessibleViewState* state) { } |
| 874 | 870 |
| 875 #if defined(OS_WIN) | 871 // Returns an instance of the native accessibility interface for this View. |
| 876 // Returns an instance of the Windows-specific accessibility interface | 872 virtual gfx::NativeAccessibleView GetNativeAccessibleView(); |
| 877 // for this View. | |
| 878 NativeViewAccessibilityWin* GetNativeViewAccessibilityWin(); | |
| 879 #endif | |
| 880 | 873 |
| 881 // Scrolling ----------------------------------------------------------------- | 874 // Scrolling ----------------------------------------------------------------- |
| 882 // TODO(beng): Figure out if this can live somewhere other than View, i.e. | 875 // TODO(beng): Figure out if this can live somewhere other than View, i.e. |
| 883 // closer to ScrollView. | 876 // closer to ScrollView. |
| 884 | 877 |
| 885 // Scrolls the specified region, in this View's coordinate system, to be | 878 // Scrolls the specified region, in this View's coordinate system, to be |
| 886 // visible. View's implementation passes the call onto the parent View (after | 879 // visible. View's implementation passes the call onto the parent View (after |
| 887 // adjusting the coordinates). It is up to views that only show a portion of | 880 // adjusting the coordinates). It is up to views that only show a portion of |
| 888 // the child view, such as Viewport, to override appropriately. | 881 // the child view, such as Viewport, to override appropriately. |
| 889 virtual void ScrollRectToVisible(const gfx::Rect& rect); | 882 virtual void ScrollRectToVisible(const gfx::Rect& rect); |
| (...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1440 | 1433 |
| 1441 // The menu controller. | 1434 // The menu controller. |
| 1442 ContextMenuController* context_menu_controller_; | 1435 ContextMenuController* context_menu_controller_; |
| 1443 | 1436 |
| 1444 // Drag and drop ------------------------------------------------------------- | 1437 // Drag and drop ------------------------------------------------------------- |
| 1445 | 1438 |
| 1446 DragController* drag_controller_; | 1439 DragController* drag_controller_; |
| 1447 | 1440 |
| 1448 // Accessibility ------------------------------------------------------------- | 1441 // Accessibility ------------------------------------------------------------- |
| 1449 | 1442 |
| 1450 #if defined(OS_WIN) | |
| 1451 // The Windows-specific accessibility implementation for this View. | 1443 // The Windows-specific accessibility implementation for this View. |
| 1444 #ifdef OS_WIN | |
|
tfarina
2011/06/10 20:09:01
the old code is corrected and the preferred way.
dmazzoni
2011/06/10 22:38:40
Done.
| |
| 1452 scoped_refptr<NativeViewAccessibilityWin> native_view_accessibility_win_; | 1445 scoped_refptr<NativeViewAccessibilityWin> native_view_accessibility_win_; |
| 1453 #endif | 1446 #endif |
| 1454 | 1447 |
| 1455 DISALLOW_COPY_AND_ASSIGN(View); | 1448 DISALLOW_COPY_AND_ASSIGN(View); |
| 1456 }; | 1449 }; |
| 1457 | 1450 |
| 1458 } // namespace views | 1451 } // namespace views |
| 1459 | 1452 |
| 1460 #endif // VIEWS_VIEW_H_ | 1453 #endif // VIEWS_VIEW_H_ |
| OLD | NEW |