| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "app/gfx/insets.h" | 7 #include "app/gfx/insets.h" |
| 8 #if defined(OS_WIN) | 8 #if defined(OS_WIN) |
| 9 #include "app/win_util.h" | 9 #include "app/win_util.h" |
| 10 #endif | 10 #endif |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 void Textfield::SyncText() { | 155 void Textfield::SyncText() { |
| 156 if (native_wrapper_) | 156 if (native_wrapper_) |
| 157 text_ = native_wrapper_->GetText(); | 157 text_ = native_wrapper_->GetText(); |
| 158 } | 158 } |
| 159 | 159 |
| 160 // static | 160 // static |
| 161 bool Textfield::IsKeystrokeEnter(const Keystroke& key) { | 161 bool Textfield::IsKeystrokeEnter(const Keystroke& key) { |
| 162 #if defined(OS_WIN) | 162 #if defined(OS_WIN) |
| 163 return key.key == VK_RETURN; | 163 return key.key == VK_RETURN; |
| 164 #else | 164 #else |
| 165 // TODO(port): figure out VK_constants |
| 165 NOTIMPLEMENTED(); | 166 NOTIMPLEMENTED(); |
| 166 return false; | 167 return false; |
| 167 #endif | 168 #endif |
| 168 } | 169 } |
| 169 | 170 |
| 170 // static | 171 // static |
| 171 bool Textfield::IsKeystrokeEscape(const Keystroke& key) { | 172 bool Textfield::IsKeystrokeEscape(const Keystroke& key) { |
| 172 #if defined(OS_WIN) | 173 #if defined(OS_WIN) |
| 173 return key.key == VK_ESCAPE; | 174 return key.key == VK_ESCAPE; |
| 174 #else | 175 #else |
| 176 // TODO(port): figure out VK_constants |
| 175 NOTIMPLEMENTED(); | 177 NOTIMPLEMENTED(); |
| 176 return false; | 178 return false; |
| 177 #endif | 179 #endif |
| 178 } | 180 } |
| 179 | 181 |
| 180 //////////////////////////////////////////////////////////////////////////////// | 182 //////////////////////////////////////////////////////////////////////////////// |
| 181 // Textfield, View overrides: | 183 // Textfield, View overrides: |
| 182 | 184 |
| 183 void Textfield::Layout() { | 185 void Textfield::Layout() { |
| 184 if (native_wrapper_) { | 186 if (native_wrapper_) { |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 native_wrapper_->UpdateEnabled(); | 253 native_wrapper_->UpdateEnabled(); |
| 252 native_wrapper_->UpdateBorder(); | 254 native_wrapper_->UpdateBorder(); |
| 253 } | 255 } |
| 254 } | 256 } |
| 255 | 257 |
| 256 std::string Textfield::GetClassName() const { | 258 std::string Textfield::GetClassName() const { |
| 257 return kViewClassName; | 259 return kViewClassName; |
| 258 } | 260 } |
| 259 | 261 |
| 260 } // namespace views | 262 } // namespace views |
| OLD | NEW |