| 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 const View* parent() const { return parent_; } | 215 const View* parent() const { return parent_; } |
| 216 View* parent() { return parent_; } | 216 View* parent() { return parent_; } |
| 217 | 217 |
| 218 // Returns true if |view| is contained within this View's hierarchy, even as | 218 // Returns true if |view| is contained within this View's hierarchy, even as |
| 219 // an indirect descendant. Will return true if child is also this view. | 219 // an indirect descendant. Will return true if child is also this view. |
| 220 bool Contains(const View* view) const; | 220 bool Contains(const View* view) const; |
| 221 | 221 |
| 222 // Returns the index of |view|, or -1 if |view| is not a child of this view. | 222 // Returns the index of |view|, or -1 if |view| is not a child of this view. |
| 223 int GetIndexOf(const View* view) const; | 223 int GetIndexOf(const View* view) const; |
| 224 | 224 |
| 225 // TODO(beng): REMOVE (Views need not know about Window). | |
| 226 // Gets the Widget that most closely contains this View, if any. | |
| 227 // NOTE: almost all views displayed on screen have a Widget, but not | |
| 228 // necessarily a Window. This is due to widgets being able to create top | |
| 229 // level windows (as is done for popups, bubbles and menus). | |
| 230 virtual const Window* GetWindow() const; | |
| 231 virtual Window* GetWindow(); | |
| 232 | |
| 233 // TODO(beng): REMOVE (TBD) | 225 // TODO(beng): REMOVE (TBD) |
| 234 // Returns true if the native view |native_view| is contained in the view | 226 // Returns true if the native view |native_view| is contained in the view |
| 235 // hierarchy beneath this view. | 227 // hierarchy beneath this view. |
| 236 virtual bool ContainsNativeView(gfx::NativeView native_view) const; | 228 virtual bool ContainsNativeView(gfx::NativeView native_view) const; |
| 237 | 229 |
| 238 // Size and disposition ------------------------------------------------------ | 230 // Size and disposition ------------------------------------------------------ |
| 239 // Methods for obtaining and modifying the position and size of the view. | 231 // Methods for obtaining and modifying the position and size of the view. |
| 240 // Position is in the coordinate system of the view's parent. | 232 // Position is in the coordinate system of the view's parent. |
| 241 // Position is NOT flipped for RTL. See "RTL positioning" for RTL-sensitive | 233 // Position is NOT flipped for RTL. See "RTL positioning" for RTL-sensitive |
| 242 // position accessors. | 234 // position accessors. |
| (...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1459 // The Windows-specific accessibility implementation for this View. | 1451 // The Windows-specific accessibility implementation for this View. |
| 1460 scoped_refptr<NativeViewAccessibilityWin> native_view_accessibility_win_; | 1452 scoped_refptr<NativeViewAccessibilityWin> native_view_accessibility_win_; |
| 1461 #endif | 1453 #endif |
| 1462 | 1454 |
| 1463 DISALLOW_COPY_AND_ASSIGN(View); | 1455 DISALLOW_COPY_AND_ASSIGN(View); |
| 1464 }; | 1456 }; |
| 1465 | 1457 |
| 1466 } // namespace views | 1458 } // namespace views |
| 1467 | 1459 |
| 1468 #endif // VIEWS_VIEW_H_ | 1460 #endif // VIEWS_VIEW_H_ |
| OLD | NEW |