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

Unified Diff: ui/views/controls/textfield/textfield.cc

Issue 8964001: views: Convert IsFocusable() to just focusable() since it's just a simple accessor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: don't need to override IsFocusableInRootView in omnibox_view_views Created 9 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/controls/textfield/textfield.h ('k') | ui/views/view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/textfield/textfield.cc
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc
index ffbabe0293fd7f5bf30d1ed85dd038742815a80e..e2beb4d9168ecf5c4bbaf06eb79702a8e6b00c66 100644
--- a/ui/views/controls/textfield/textfield.cc
+++ b/ui/views/controls/textfield/textfield.cc
@@ -92,6 +92,7 @@ TextfieldController* Textfield::GetController() const {
void Textfield::SetReadOnly(bool read_only) {
read_only_ = read_only;
+ set_focusable(!read_only);
if (native_wrapper_) {
native_wrapper_->UpdateReadOnly();
native_wrapper_->UpdateTextColor();
@@ -330,10 +331,6 @@ gfx::Size Textfield::GetPreferredSize() {
insets.width(), font_.GetHeight() + insets.height());
}
-bool Textfield::IsFocusable() const {
- return View::IsFocusable() && !read_only_;
-}
-
void Textfield::AboutToRequestFocusFromTabTraversal(bool reverse) {
SelectAll();
}
« no previous file with comments | « ui/views/controls/textfield/textfield.h ('k') | ui/views/view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698