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

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

Issue 6004010: Implement clipboard features in views textfield. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: code style fixes Created 9 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ 5 #ifndef VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_
6 #define VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ 6 #define VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_
7 #pragma once 7 #pragma once
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 119
120 // Clears selection. 120 // Clears selection.
121 void ClearSelection(); 121 void ClearSelection();
122 122
123 // Returns visible text. If the field is password, it returns the 123 // Returns visible text. If the field is password, it returns the
124 // sequence of "*". 124 // sequence of "*".
125 string16 GetVisibleText() const { 125 string16 GetVisibleText() const {
126 return GetVisibleText(0U, text_.length()); 126 return GetVisibleText(0U, text_.length());
127 } 127 }
128 128
129 // Cuts the currently selected text and puts it to clipboard. Returns true
130 // if text has changed after cutting.
131 bool Cut();
132
133 // Copies the currently selected text and puts it to clipboard.
134 void Copy();
135
136 // Pastes text from the clipboard at current cursor position. Returns true
137 // if text has changed after pasting.
138 bool Paste();
139
129 private: 140 private:
130 friend class NativeTextfieldViews; 141 friend class NativeTextfieldViews;
131 142
132 // Tells if any text is selected. 143 // Tells if any text is selected.
133 bool HasSelection() const; 144 bool HasSelection() const;
134 145
135 // Deletes the selected text. 146 // Deletes the selected text.
136 void DeleteSelection(); 147 void DeleteSelection();
137 148
138 // Returns the visible text given |start| and |end|. 149 // Returns the visible text given |start| and |end|.
(...skipping 10 matching lines...) Expand all
149 160
150 // True if the text is the password. 161 // True if the text is the password.
151 bool is_password_; 162 bool is_password_;
152 163
153 DISALLOW_COPY_AND_ASSIGN(TextfieldViewsModel); 164 DISALLOW_COPY_AND_ASSIGN(TextfieldViewsModel);
154 }; 165 };
155 166
156 } // namespace views 167 } // namespace views
157 168
158 #endif // VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ 169 #endif // VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_
OLDNEW
« no previous file with comments | « views/controls/textfield/native_textfield_views.cc ('k') | views/controls/textfield/textfield_views_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698