Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: ui/views/controls/textfield/textfield.h

Issue 2688883002: Revert [MacViews] Implemented text context menu (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/views/controls/label.cc ('k') | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_CONTROLS_TEXTFIELD_TEXTFIELD_H_ 5 #ifndef UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_
6 #define UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ 6 #define UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 20 matching lines...) Expand all
31 #include "ui/views/drag_controller.h" 31 #include "ui/views/drag_controller.h"
32 #include "ui/views/selection_controller.h" 32 #include "ui/views/selection_controller.h"
33 #include "ui/views/selection_controller_delegate.h" 33 #include "ui/views/selection_controller_delegate.h"
34 #include "ui/views/view.h" 34 #include "ui/views/view.h"
35 #include "ui/views/word_lookup_client.h" 35 #include "ui/views/word_lookup_client.h"
36 36
37 namespace views { 37 namespace views {
38 38
39 class MenuRunner; 39 class MenuRunner;
40 class TextfieldController; 40 class TextfieldController;
41 class ViewsTextServicesContextMenu;
42 41
43 // A views/skia textfield implementation. No platform-specific code is used. 42 // A views/skia textfield implementation. No platform-specific code is used.
44 class VIEWS_EXPORT Textfield : public View, 43 class VIEWS_EXPORT Textfield : public View,
45 public TextfieldModel::Delegate, 44 public TextfieldModel::Delegate,
46 public ContextMenuController, 45 public ContextMenuController,
47 public DragController, 46 public DragController,
48 public WordLookupClient, 47 public WordLookupClient,
49 public SelectionControllerDelegate, 48 public SelectionControllerDelegate,
50 public ui::TouchEditable, 49 public ui::TouchEditable,
51 public ui::TextInputClient { 50 public ui::TextInputClient {
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 // DragController overrides: 257 // DragController overrides:
259 void WriteDragDataForView(View* sender, 258 void WriteDragDataForView(View* sender,
260 const gfx::Point& press_pt, 259 const gfx::Point& press_pt,
261 ui::OSExchangeData* data) override; 260 ui::OSExchangeData* data) override;
262 int GetDragOperationsForView(View* sender, const gfx::Point& p) override; 261 int GetDragOperationsForView(View* sender, const gfx::Point& p) override;
263 bool CanStartDragForView(View* sender, 262 bool CanStartDragForView(View* sender,
264 const gfx::Point& press_pt, 263 const gfx::Point& press_pt,
265 const gfx::Point& p) override; 264 const gfx::Point& p) override;
266 265
267 // WordLookupClient overrides: 266 // WordLookupClient overrides:
268 bool GetDecoratedWordAndBaselineAtPoint(const gfx::Point& point, 267 bool GetDecoratedWordAtPoint(const gfx::Point& point,
269 gfx::DecoratedText* decorated_word, 268 gfx::DecoratedText* decorated_word,
270 gfx::Point* baseline_point) override; 269 gfx::Point* baseline_point) override;
271 bool GetDecoratedTextAndBaselineFromSelection(
272 gfx::DecoratedText* decorated_text,
273 gfx::Point* baseline_point) override;
274 270
275 // SelectionControllerDelegate overrides: 271 // SelectionControllerDelegate overrides:
276 bool HasTextBeingDragged() const override; 272 bool HasTextBeingDragged() const override;
277 273
278 // ui::TouchEditable overrides: 274 // ui::TouchEditable overrides:
279 void SelectRect(const gfx::Point& start, const gfx::Point& end) override; 275 void SelectRect(const gfx::Point& start, const gfx::Point& end) override;
280 void MoveCaretTo(const gfx::Point& point) override; 276 void MoveCaretTo(const gfx::Point& point) override;
281 void GetSelectionEndPoints(gfx::SelectionBound* anchor, 277 void GetSelectionEndPoints(gfx::SelectionBound* anchor,
282 gfx::SelectionBound* focus) override; 278 gfx::SelectionBound* focus) override;
283 gfx::Rect GetBounds() override; 279 gfx::Rect GetBounds() override;
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 515
520 // Tracks if touch editing handles are hidden because user has started 516 // Tracks if touch editing handles are hidden because user has started
521 // scrolling. If |true|, handles are shown after scrolling ends. 517 // scrolling. If |true|, handles are shown after scrolling ends.
522 bool touch_handles_hidden_due_to_scroll_; 518 bool touch_handles_hidden_due_to_scroll_;
523 519
524 // True if this textfield should use a focus ring to indicate focus. 520 // True if this textfield should use a focus ring to indicate focus.
525 bool use_focus_ring_; 521 bool use_focus_ring_;
526 522
527 // Context menu related members. 523 // Context menu related members.
528 std::unique_ptr<ui::SimpleMenuModel> context_menu_contents_; 524 std::unique_ptr<ui::SimpleMenuModel> context_menu_contents_;
529 std::unique_ptr<ViewsTextServicesContextMenu> text_services_context_menu_;
530 std::unique_ptr<views::MenuRunner> context_menu_runner_; 525 std::unique_ptr<views::MenuRunner> context_menu_runner_;
531 526
532 // Used to bind callback functions to this object. 527 // Used to bind callback functions to this object.
533 base::WeakPtrFactory<Textfield> weak_ptr_factory_; 528 base::WeakPtrFactory<Textfield> weak_ptr_factory_;
534 529
535 DISALLOW_COPY_AND_ASSIGN(Textfield); 530 DISALLOW_COPY_AND_ASSIGN(Textfield);
536 }; 531 };
537 532
538 } // namespace views 533 } // namespace views
539 534
540 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ 535 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_
OLDNEW
« no previous file with comments | « ui/views/controls/label.cc ('k') | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698