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

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

Issue 2273263002: MacViewsBrowser: Fix omnibox crash due to failed DCHECK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile. Created 4 years, 3 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
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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 205
206 // View overrides: 206 // View overrides:
207 gfx::Insets GetInsets() const override; 207 gfx::Insets GetInsets() const override;
208 int GetBaseline() const override; 208 int GetBaseline() const override;
209 gfx::Size GetPreferredSize() const override; 209 gfx::Size GetPreferredSize() const override;
210 const char* GetClassName() const override; 210 const char* GetClassName() const override;
211 gfx::NativeCursor GetCursor(const ui::MouseEvent& event) override; 211 gfx::NativeCursor GetCursor(const ui::MouseEvent& event) override;
212 bool OnMousePressed(const ui::MouseEvent& event) override; 212 bool OnMousePressed(const ui::MouseEvent& event) override;
213 bool OnMouseDragged(const ui::MouseEvent& event) override; 213 bool OnMouseDragged(const ui::MouseEvent& event) override;
214 void OnMouseReleased(const ui::MouseEvent& event) override; 214 void OnMouseReleased(const ui::MouseEvent& event) override;
215 bool OnKeyPressed(const ui::KeyEvent& event) override;
216 bool OnKeyReleased(const ui::KeyEvent& event) override;
217 void OnGestureEvent(ui::GestureEvent* event) override; 215 void OnGestureEvent(ui::GestureEvent* event) override;
218 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; 216 bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
219 bool CanHandleAccelerators() const override; 217 bool CanHandleAccelerators() const override;
220 void AboutToRequestFocusFromTabTraversal(bool reverse) override; 218 void AboutToRequestFocusFromTabTraversal(bool reverse) override;
221 bool SkipDefaultKeyEventProcessing(const ui::KeyEvent& event) override; 219 bool SkipDefaultKeyEventProcessing(const ui::KeyEvent& event) override;
222 bool GetDropFormats( 220 bool GetDropFormats(
223 int* formats, 221 int* formats,
224 std::set<ui::Clipboard::FormatType>* format_types) override; 222 std::set<ui::Clipboard::FormatType>* format_types) override;
225 bool CanDrop(const ui::OSExchangeData& data) override; 223 bool CanDrop(const ui::OSExchangeData& data) override;
226 int OnDragUpdated(const ui::DropTargetEvent& event) override; 224 int OnDragUpdated(const ui::DropTargetEvent& event) override;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 312
315 gfx::Point last_click_location() const { return last_click_location_; } 313 gfx::Point last_click_location() const { return last_click_location_; }
316 314
317 // Get the text from the selection clipboard. 315 // Get the text from the selection clipboard.
318 virtual base::string16 GetSelectionClipboardText() const; 316 virtual base::string16 GetSelectionClipboardText() const;
319 317
320 // Executes the given |command|. 318 // Executes the given |command|.
321 virtual void ExecuteTextEditCommand(ui::TextEditCommand command); 319 virtual void ExecuteTextEditCommand(ui::TextEditCommand command);
322 320
323 private: 321 private:
322 friend class TestTextfield;
324 friend class TextfieldTestApi; 323 friend class TextfieldTestApi;
325 324
325 // View overrides:
326 // OnKey[Pressed/Released] are virtual only so that they can be overridden in
327 // tests. Subclasses should not override these, since it would interfere with
328 // the accounting related to the scheduled text edit command. Instead
329 // subclasses should use TextfieldController::HandleKeyEvent, to intercept the
330 // key event.
331 bool OnKeyPressed(const ui::KeyEvent& event) override;
332 bool OnKeyReleased(const ui::KeyEvent& event) override;
333
326 // Handles a request to change the value of this text field from software 334 // Handles a request to change the value of this text field from software
327 // using an accessibility API (typically automation software, screen readers 335 // using an accessibility API (typically automation software, screen readers
328 // don't normally use this). Sets the value and clears the selection. 336 // don't normally use this). Sets the value and clears the selection.
329 void AccessibilitySetValue(const base::string16& new_value); 337 void AccessibilitySetValue(const base::string16& new_value);
330 338
331 // Updates the painted background color. 339 // Updates the painted background color.
332 void UpdateBackgroundColor(); 340 void UpdateBackgroundColor();
333 341
334 // Does necessary updates when the text and/or cursor position changes. 342 // Does necessary updates when the text and/or cursor position changes.
335 void UpdateAfterChange(bool text_changed, bool cursor_changed); 343 void UpdateAfterChange(bool text_changed, bool cursor_changed);
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 492
485 // Used to bind callback functions to this object. 493 // Used to bind callback functions to this object.
486 base::WeakPtrFactory<Textfield> weak_ptr_factory_; 494 base::WeakPtrFactory<Textfield> weak_ptr_factory_;
487 495
488 DISALLOW_COPY_AND_ASSIGN(Textfield); 496 DISALLOW_COPY_AND_ASSIGN(Textfield);
489 }; 497 };
490 498
491 } // namespace views 499 } // namespace views
492 500
493 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ 501 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698