| 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/accessibility/accessibility_types.h" | 20 #include "ui/base/accessibility/accessibility_types.h" |
| 21 #include "ui/base/dragdrop/drag_drop_types.h" | 21 #include "ui/base/dragdrop/drag_drop_types.h" |
| 22 #include "ui/base/dragdrop/os_exchange_data.h" | 22 #include "ui/base/dragdrop/os_exchange_data.h" |
| 23 #include "ui/base/events/event.h" | 23 #include "ui/base/events/event.h" |
| 24 #include "ui/base/events/event_target.h" | 24 #include "ui/base/events/event_target.h" |
| 25 #include "ui/base/ui_base_types.h" |
| 25 #include "ui/compositor/layer_delegate.h" | 26 #include "ui/compositor/layer_delegate.h" |
| 26 #include "ui/compositor/layer_owner.h" | 27 #include "ui/compositor/layer_owner.h" |
| 27 #include "ui/gfx/native_widget_types.h" | 28 #include "ui/gfx/native_widget_types.h" |
| 28 #include "ui/gfx/rect.h" | 29 #include "ui/gfx/rect.h" |
| 29 #include "ui/gfx/vector2d.h" | 30 #include "ui/gfx/vector2d.h" |
| 30 #include "ui/views/background.h" | 31 #include "ui/views/background.h" |
| 31 #include "ui/views/border.h" | 32 #include "ui/views/border.h" |
| 32 #include "ui/views/focus_border.h" | 33 #include "ui/views/focus_border.h" |
| 33 | 34 |
| 34 #if defined(OS_WIN) | 35 #if defined(OS_WIN) |
| (...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 void set_context_menu_controller(ContextMenuController* menu_controller) { | 820 void set_context_menu_controller(ContextMenuController* menu_controller) { |
| 820 context_menu_controller_ = menu_controller; | 821 context_menu_controller_ = menu_controller; |
| 821 } | 822 } |
| 822 | 823 |
| 823 // Provides default implementation for context menu handling. The default | 824 // Provides default implementation for context menu handling. The default |
| 824 // implementation calls the ShowContextMenu of the current | 825 // implementation calls the ShowContextMenu of the current |
| 825 // ContextMenuController (if it is not NULL). Overridden in subclassed views | 826 // ContextMenuController (if it is not NULL). Overridden in subclassed views |
| 826 // to provide right-click menu display triggerd by the keyboard (i.e. for the | 827 // to provide right-click menu display triggerd by the keyboard (i.e. for the |
| 827 // Chrome toolbar Back and Forward buttons). No source needs to be specified, | 828 // Chrome toolbar Back and Forward buttons). No source needs to be specified, |
| 828 // as it is always equal to the current View. | 829 // as it is always equal to the current View. |
| 829 virtual void ShowContextMenu(const gfx::Point& p, bool is_mouse_gesture); | 830 virtual void ShowContextMenu(const gfx::Point& p, |
| 831 ui::MenuSourceType source_type); |
| 830 | 832 |
| 831 // On some platforms, we show context menu on mouse press instead of release. | 833 // On some platforms, we show context menu on mouse press instead of release. |
| 832 // This method returns true for those platforms. | 834 // This method returns true for those platforms. |
| 833 static bool ShouldShowContextMenuOnMousePress(); | 835 static bool ShouldShowContextMenuOnMousePress(); |
| 834 | 836 |
| 835 // Drag and drop ------------------------------------------------------------- | 837 // Drag and drop ------------------------------------------------------------- |
| 836 | 838 |
| 837 DragController* drag_controller() { return drag_controller_; } | 839 DragController* drag_controller() { return drag_controller_; } |
| 838 void set_drag_controller(DragController* drag_controller) { | 840 void set_drag_controller(DragController* drag_controller) { |
| 839 drag_controller_ = drag_controller; | 841 drag_controller_ = drag_controller; |
| (...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1542 // Belongs to this view, but it's reference-counted on some platforms | 1544 // Belongs to this view, but it's reference-counted on some platforms |
| 1543 // so we can't use a scoped_ptr. It's dereferenced in the destructor. | 1545 // so we can't use a scoped_ptr. It's dereferenced in the destructor. |
| 1544 NativeViewAccessibility* native_view_accessibility_; | 1546 NativeViewAccessibility* native_view_accessibility_; |
| 1545 | 1547 |
| 1546 DISALLOW_COPY_AND_ASSIGN(View); | 1548 DISALLOW_COPY_AND_ASSIGN(View); |
| 1547 }; | 1549 }; |
| 1548 | 1550 |
| 1549 } // namespace views | 1551 } // namespace views |
| 1550 | 1552 |
| 1551 #endif // UI_VIEWS_VIEW_H_ | 1553 #endif // UI_VIEWS_VIEW_H_ |
| OLD | NEW |