| OLD | NEW |
| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 | 100 |
| 101 void Textfield::SetPassword(bool password) { | 101 void Textfield::SetPassword(bool password) { |
| 102 if (password) | 102 if (password) |
| 103 style_ = static_cast<StyleFlags>(style_ | STYLE_PASSWORD); | 103 style_ = static_cast<StyleFlags>(style_ | STYLE_PASSWORD); |
| 104 else | 104 else |
| 105 style_ = static_cast<StyleFlags>(style_ & ~STYLE_PASSWORD); | 105 style_ = static_cast<StyleFlags>(style_ & ~STYLE_PASSWORD); |
| 106 if (native_wrapper_) | 106 if (native_wrapper_) |
| 107 native_wrapper_->UpdateIsPassword(); | 107 native_wrapper_->UpdateIsPassword(); |
| 108 } | 108 } |
| 109 | 109 |
| 110 bool Textfield::IsUrl() const { |
| 111 return style_ & STYLE_URL; |
| 112 } |
| 113 |
| 114 void Textfield::SetUrl(bool url) { |
| 115 if (url) |
| 116 style_ = static_cast<StyleFlags>(style_ | STYLE_URL); |
| 117 else |
| 118 style_ = static_cast<StyleFlags>(style_ & ~STYLE_URL); |
| 119 } |
| 120 |
| 110 void Textfield::SetText(const string16& text) { | 121 void Textfield::SetText(const string16& text) { |
| 111 text_ = text; | 122 text_ = text; |
| 112 if (native_wrapper_) | 123 if (native_wrapper_) |
| 113 native_wrapper_->UpdateText(); | 124 native_wrapper_->UpdateText(); |
| 114 } | 125 } |
| 115 | 126 |
| 116 void Textfield::AppendText(const string16& text) { | 127 void Textfield::AppendText(const string16& text) { |
| 117 text_ += text; | 128 text_ += text; |
| 118 if (native_wrapper_) | 129 if (native_wrapper_) |
| 119 native_wrapper_->AppendText(text); | 130 native_wrapper_->AppendText(text); |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 } | 422 } |
| 412 #endif | 423 #endif |
| 413 } | 424 } |
| 414 } | 425 } |
| 415 | 426 |
| 416 std::string Textfield::GetClassName() const { | 427 std::string Textfield::GetClassName() const { |
| 417 return kViewClassName; | 428 return kViewClassName; |
| 418 } | 429 } |
| 419 | 430 |
| 420 } // namespace views | 431 } // namespace views |
| OLD | NEW |