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

Side by Side Diff: views/controls/textfield/textfield.cc

Issue 6685082: Refactor Textfield and AutocompleteEditViewViews. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename IsValidChar to ShouldInsertChar. Created 9 years, 9 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) 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 #include "views/controls/textfield/textfield.h" 5 #include "views/controls/textfield/textfield.h"
6 6
7 #if defined(OS_LINUX) 7 #if defined(OS_LINUX)
8 #include <gdk/gdkkeysyms.h> 8 #include <gdk/gdkkeysyms.h>
9 #endif 9 #endif
10 10
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 if (native_wrapper_) 134 if (native_wrapper_)
135 return native_wrapper_->GetSelectedText(); 135 return native_wrapper_->GetSelectedText();
136 return string16(); 136 return string16();
137 } 137 }
138 138
139 void Textfield::ClearSelection() const { 139 void Textfield::ClearSelection() const {
140 if (native_wrapper_) 140 if (native_wrapper_)
141 native_wrapper_->ClearSelection(); 141 native_wrapper_->ClearSelection();
142 } 142 }
143 143
144 bool Textfield::HasSelection() const {
145 ui::Range range;
146 if (native_wrapper_)
147 native_wrapper_->GetSelectedRange(&range);
148 return !range.is_empty();
149 }
150
144 void Textfield::SetTextColor(SkColor color) { 151 void Textfield::SetTextColor(SkColor color) {
145 text_color_ = color; 152 text_color_ = color;
146 use_default_text_color_ = false; 153 use_default_text_color_ = false;
147 if (native_wrapper_) 154 if (native_wrapper_)
148 native_wrapper_->UpdateTextColor(); 155 native_wrapper_->UpdateTextColor();
149 } 156 }
150 157
151 void Textfield::UseDefaultTextColor() { 158 void Textfield::UseDefaultTextColor() {
152 use_default_text_color_ = true; 159 use_default_text_color_ = true;
153 if (native_wrapper_) 160 if (native_wrapper_)
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 } 397 }
391 #endif 398 #endif
392 } 399 }
393 } 400 }
394 401
395 std::string Textfield::GetClassName() const { 402 std::string Textfield::GetClassName() const {
396 return kViewClassName; 403 return kViewClassName;
397 } 404 }
398 405
399 } // namespace views 406 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698