| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_VIEWS_VIEW_H_ | 5 #ifndef UI_VIEWS_VIEW_H_ |
| 6 #define UI_VIEWS_VIEW_H_ | 6 #define UI_VIEWS_VIEW_H_ |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/i18n/rtl.h" | 15 #include "base/i18n/rtl.h" |
| 16 #include "base/logging.h" | 16 #include "base/logging.h" |
| 17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
| 19 #include "ui/base/accelerators/accelerator.h" | 19 #include "ui/base/accelerators/accelerator.h" |
| 20 #include "ui/base/dragdrop/os_exchange_data.h" | 20 #include "ui/base/dragdrop/os_exchange_data.h" |
| 21 #include "ui/base/events/event.h" | 21 #include "ui/base/events/event.h" |
| 22 #include "ui/compositor/layer_delegate.h" | 22 #include "ui/compositor/layer_delegate.h" |
| 23 #include "ui/compositor/layer_owner.h" | 23 #include "ui/compositor/layer_owner.h" |
| 24 #include "ui/gfx/native_widget_types.h" | 24 #include "ui/gfx/native_widget_types.h" |
| 25 #include "ui/gfx/rect.h" | 25 #include "ui/gfx/rect.h" |
| 26 #include "ui/gfx/vector2d.h" |
| 26 #include "ui/views/background.h" | 27 #include "ui/views/background.h" |
| 27 #include "ui/views/border.h" | 28 #include "ui/views/border.h" |
| 28 #include "ui/views/focus_border.h" | 29 #include "ui/views/focus_border.h" |
| 29 | 30 |
| 30 #if defined(OS_WIN) | 31 #if defined(OS_WIN) |
| 31 #include "base/win/scoped_comptr.h" | 32 #include "base/win/scoped_comptr.h" |
| 32 #endif | 33 #endif |
| 33 | 34 |
| 34 using ui::OSExchangeData; | 35 using ui::OSExchangeData; |
| 35 | 36 |
| (...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 // Invoked during a drag and drop session when OnDragUpdated returns a valid | 853 // Invoked during a drag and drop session when OnDragUpdated returns a valid |
| 853 // operation and the user release the mouse. | 854 // operation and the user release the mouse. |
| 854 virtual int OnPerformDrop(const ui::DropTargetEvent& event); | 855 virtual int OnPerformDrop(const ui::DropTargetEvent& event); |
| 855 | 856 |
| 856 // Invoked from DoDrag after the drag completes. This implementation does | 857 // Invoked from DoDrag after the drag completes. This implementation does |
| 857 // nothing, and is intended for subclasses to do cleanup. | 858 // nothing, and is intended for subclasses to do cleanup. |
| 858 virtual void OnDragDone(); | 859 virtual void OnDragDone(); |
| 859 | 860 |
| 860 // Returns true if the mouse was dragged enough to start a drag operation. | 861 // Returns true if the mouse was dragged enough to start a drag operation. |
| 861 // delta_x and y are the distance the mouse was dragged. | 862 // delta_x and y are the distance the mouse was dragged. |
| 862 static bool ExceededDragThreshold(int delta_x, int delta_y); | 863 static bool ExceededDragThreshold(const gfx::Vector2d& delta); |
| 863 | 864 |
| 864 // Accessibility ------------------------------------------------------------- | 865 // Accessibility ------------------------------------------------------------- |
| 865 | 866 |
| 866 // Modifies |state| to reflect the current accessible state of this view. | 867 // Modifies |state| to reflect the current accessible state of this view. |
| 867 virtual void GetAccessibleState(ui::AccessibleViewState* state) { } | 868 virtual void GetAccessibleState(ui::AccessibleViewState* state) { } |
| 868 | 869 |
| 869 // Returns an instance of the native accessibility interface for this view. | 870 // Returns an instance of the native accessibility interface for this view. |
| 870 virtual gfx::NativeViewAccessible GetNativeViewAccessible(); | 871 virtual gfx::NativeViewAccessible GetNativeViewAccessible(); |
| 871 | 872 |
| 872 // Scrolling ----------------------------------------------------------------- | 873 // Scrolling ----------------------------------------------------------------- |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1482 base::win::ScopedComPtr<NativeViewAccessibilityWin> | 1483 base::win::ScopedComPtr<NativeViewAccessibilityWin> |
| 1483 native_view_accessibility_win_; | 1484 native_view_accessibility_win_; |
| 1484 #endif | 1485 #endif |
| 1485 | 1486 |
| 1486 DISALLOW_COPY_AND_ASSIGN(View); | 1487 DISALLOW_COPY_AND_ASSIGN(View); |
| 1487 }; | 1488 }; |
| 1488 | 1489 |
| 1489 } // namespace views | 1490 } // namespace views |
| 1490 | 1491 |
| 1491 #endif // UI_VIEWS_VIEW_H_ | 1492 #endif // UI_VIEWS_VIEW_H_ |
| OLD | NEW |