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 UI_VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_VIEWS_H_ | 5 #ifndef UI_VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_VIEWS_H_ |
6 #define UI_VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_VIEWS_H_ | 6 #define UI_VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_VIEWS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
11 #include "ui/base/ime/text_input_client.h" | 11 #include "ui/base/ime/text_input_client.h" |
12 #include "ui/base/models/simple_menu_model.h" | 12 #include "ui/base/models/simple_menu_model.h" |
13 #include "ui/gfx/font.h" | 13 #include "ui/gfx/font.h" |
| 14 #include "ui/views/context_menu_controller.h" |
14 #include "ui/views/controls/textfield/native_textfield_wrapper.h" | 15 #include "ui/views/controls/textfield/native_textfield_wrapper.h" |
15 #include "ui/views/controls/textfield/textfield_views_model.h" | 16 #include "ui/views/controls/textfield/textfield_views_model.h" |
| 17 #include "ui/views/drag_controller.h" |
16 #include "ui/views/touchui/touch_selection_controller.h" | 18 #include "ui/views/touchui/touch_selection_controller.h" |
17 #include "views/border.h" | 19 #include "views/border.h" |
18 #include "views/context_menu_controller.h" | |
19 #include "views/drag_controller.h" | |
20 #include "views/view.h" | 20 #include "views/view.h" |
21 | 21 |
22 namespace base { | 22 namespace base { |
23 class Time; | 23 class Time; |
24 } | 24 } |
25 | 25 |
26 namespace gfx { | 26 namespace gfx { |
27 class Canvas; | 27 class Canvas; |
28 } | 28 } |
29 | 29 |
(...skipping 23 matching lines...) Expand all Loading... |
53 virtual ~NativeTextfieldViews(); | 53 virtual ~NativeTextfieldViews(); |
54 | 54 |
55 // View overrides: | 55 // View overrides: |
56 virtual gfx::NativeCursor GetCursor(const MouseEvent& event) OVERRIDE; | 56 virtual gfx::NativeCursor GetCursor(const MouseEvent& event) OVERRIDE; |
57 virtual bool OnMousePressed(const MouseEvent& event) OVERRIDE; | 57 virtual bool OnMousePressed(const MouseEvent& event) OVERRIDE; |
58 virtual bool OnMouseDragged(const MouseEvent& event) OVERRIDE; | 58 virtual bool OnMouseDragged(const MouseEvent& event) OVERRIDE; |
59 virtual void OnMouseReleased(const MouseEvent& event) OVERRIDE; | 59 virtual void OnMouseReleased(const MouseEvent& event) OVERRIDE; |
60 virtual bool OnKeyPressed(const KeyEvent& event) OVERRIDE; | 60 virtual bool OnKeyPressed(const KeyEvent& event) OVERRIDE; |
61 virtual bool GetDropFormats( | 61 virtual bool GetDropFormats( |
62 int* formats, | 62 int* formats, |
63 std::set<OSExchangeData::CustomFormat>* custom_formats) OVERRIDE; | 63 std::set<ui::OSExchangeData::CustomFormat>* custom_formats) OVERRIDE; |
64 virtual bool CanDrop(const OSExchangeData& data) OVERRIDE; | 64 virtual bool CanDrop(const ui::OSExchangeData& data) OVERRIDE; |
65 virtual int OnDragUpdated(const DropTargetEvent& event) OVERRIDE; | 65 virtual int OnDragUpdated(const DropTargetEvent& event) OVERRIDE; |
66 virtual int OnPerformDrop(const DropTargetEvent& event) OVERRIDE; | 66 virtual int OnPerformDrop(const DropTargetEvent& event) OVERRIDE; |
67 virtual void OnDragDone() OVERRIDE; | 67 virtual void OnDragDone() OVERRIDE; |
68 virtual bool OnKeyReleased(const KeyEvent& event) OVERRIDE; | 68 virtual bool OnKeyReleased(const KeyEvent& event) OVERRIDE; |
69 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 69 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
70 virtual void OnFocus() OVERRIDE; | 70 virtual void OnFocus() OVERRIDE; |
71 virtual void OnBlur() OVERRIDE; | 71 virtual void OnBlur() OVERRIDE; |
72 | 72 |
73 // TouchSelectionClientView overrides: | 73 // TouchSelectionClientView overrides: |
74 virtual void SelectRect(const gfx::Point& start, | 74 virtual void SelectRect(const gfx::Point& start, |
75 const gfx::Point& end) OVERRIDE; | 75 const gfx::Point& end) OVERRIDE; |
76 | 76 |
77 // ContextMenuController overrides: | 77 // ContextMenuController overrides: |
78 virtual void ShowContextMenuForView(View* source, | 78 virtual void ShowContextMenuForView(View* source, |
79 const gfx::Point& p, | 79 const gfx::Point& p, |
80 bool is_mouse_gesture) OVERRIDE; | 80 bool is_mouse_gesture) OVERRIDE; |
81 | 81 |
82 // Overridden from DragController: | 82 // Overridden from DragController: |
83 virtual void WriteDragDataForView(View* sender, | 83 virtual void WriteDragDataForView(View* sender, |
84 const gfx::Point& press_pt, | 84 const gfx::Point& press_pt, |
85 OSExchangeData* data) OVERRIDE; | 85 ui::OSExchangeData* data) OVERRIDE; |
86 virtual int GetDragOperationsForView(View* sender, | 86 virtual int GetDragOperationsForView(View* sender, |
87 const gfx::Point& p) OVERRIDE; | 87 const gfx::Point& p) OVERRIDE; |
88 virtual bool CanStartDragForView(View* sender, | 88 virtual bool CanStartDragForView(View* sender, |
89 const gfx::Point& press_pt, | 89 const gfx::Point& press_pt, |
90 const gfx::Point& p) OVERRIDE; | 90 const gfx::Point& p) OVERRIDE; |
91 | 91 |
92 // NativeTextfieldWrapper overrides: | 92 // NativeTextfieldWrapper overrides: |
93 virtual string16 GetText() const OVERRIDE; | 93 virtual string16 GetText() const OVERRIDE; |
94 virtual void UpdateText() OVERRIDE; | 94 virtual void UpdateText() OVERRIDE; |
95 virtual void AppendText(const string16& text) OVERRIDE; | 95 virtual void AppendText(const string16& text) OVERRIDE; |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 scoped_ptr<views::MenuRunner> context_menu_runner_; | 258 scoped_ptr<views::MenuRunner> context_menu_runner_; |
259 | 259 |
260 scoped_ptr<TouchSelectionController> touch_selection_controller_; | 260 scoped_ptr<TouchSelectionController> touch_selection_controller_; |
261 | 261 |
262 DISALLOW_COPY_AND_ASSIGN(NativeTextfieldViews); | 262 DISALLOW_COPY_AND_ASSIGN(NativeTextfieldViews); |
263 }; | 263 }; |
264 | 264 |
265 } // namespace views | 265 } // namespace views |
266 | 266 |
267 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_VIEWS_H_ | 267 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_VIEWS_H_ |
OLD | NEW |