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

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: Modified according to comments 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
11 #include "app/keyboard_codes.h"
rjkroege 2011/01/05 18:40:16 you can remove this now yes?
oshima 2011/01/05 18:50:30 should be. On 2011/01/05 18:40:16, rjkroege wrote
varunjain 2011/01/05 19:03:35 Done.
11 #include "base/string16.h" 12 #include "base/string16.h"
12 #include "gfx/rect.h" 13 #include "gfx/rect.h"
13 #include "third_party/skia/include/core/SkColor.h" 14 #include "third_party/skia/include/core/SkColor.h"
14 15
15 namespace gfx { 16 namespace gfx {
16 class Font; 17 class Font;
17 } // namespace gfx 18 } // namespace gfx
18 19
19 namespace views { 20 namespace views {
20 21
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 120
120 // Clears selection. 121 // Clears selection.
121 void ClearSelection(); 122 void ClearSelection();
122 123
123 // Returns visible text. If the field is password, it returns the 124 // Returns visible text. If the field is password, it returns the
124 // sequence of "*". 125 // sequence of "*".
125 string16 GetVisibleText() const { 126 string16 GetVisibleText() const {
126 return GetVisibleText(0U, text_.length()); 127 return GetVisibleText(0U, text_.length());
127 } 128 }
128 129
130 // Cuts the currently selected text and puts it to clipboard. Returns true
131 // if text has changed after cutting.
132 bool Cut();
133
134 // Copies the currently selected text and puts it to clipboard.
135 void Copy();
136
137 // Pastes text from the clipboard at current cursor position. Returns true
138 // if text has changed after pasting.
139 bool Paste();
140
129 private: 141 private:
130 friend class NativeTextfieldViews; 142 friend class NativeTextfieldViews;
131 143
132 // Tells if any text is selected. 144 // Tells if any text is selected.
133 bool HasSelection() const; 145 bool HasSelection() const;
134 146
135 // Deletes the selected text. 147 // Deletes the selected text.
136 void DeleteSelection(); 148 void DeleteSelection();
137 149
138 // Returns the visible text given |start| and |end|. 150 // Returns the visible text given |start| and |end|.
(...skipping 10 matching lines...) Expand all
149 161
150 // True if the text is the password. 162 // True if the text is the password.
151 bool is_password_; 163 bool is_password_;
152 164
153 DISALLOW_COPY_AND_ASSIGN(TextfieldViewsModel); 165 DISALLOW_COPY_AND_ASSIGN(TextfieldViewsModel);
154 }; 166 };
155 167
156 } // namespace views 168 } // namespace views
157 169
158 #endif // VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ 170 #endif // VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698