| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/views/controls/textfield/native_textfield_views.h" | 5 #include "ui/views/controls/textfield/native_textfield_views.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 key_received_ = true; | 72 key_received_ = true; |
| 73 key_handled_ = views::Textfield::OnKeyReleased(e); | 73 key_handled_ = views::Textfield::OnKeyReleased(e); |
| 74 return key_handled_; | 74 return key_handled_; |
| 75 } | 75 } |
| 76 | 76 |
| 77 bool key_handled() const { return key_handled_; } | 77 bool key_handled() const { return key_handled_; } |
| 78 bool key_received() const { return key_received_; } | 78 bool key_received() const { return key_received_; } |
| 79 | 79 |
| 80 void clear() { key_received_ = key_handled_ = false; } | 80 void clear() { key_received_ = key_handled_ = false; } |
| 81 | 81 |
| 82 bool focusable() const { return View::focusable(); } |
| 83 |
| 82 private: | 84 private: |
| 83 bool key_handled_; | 85 bool key_handled_; |
| 84 bool key_received_; | 86 bool key_received_; |
| 85 | 87 |
| 86 DISALLOW_COPY_AND_ASSIGN(TestTextfield); | 88 DISALLOW_COPY_AND_ASSIGN(TestTextfield); |
| 87 }; | 89 }; |
| 88 | 90 |
| 89 // A helper class for use with ui::TextInputClient::GetTextFromRange(). | 91 // A helper class for use with ui::TextInputClient::GetTextFromRange(). |
| 90 class GetTextHelper { | 92 class GetTextHelper { |
| 91 public: | 93 public: |
| (...skipping 1899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1991 // Set text which may fall back to a font which has taller baseline than | 1993 // Set text which may fall back to a font which has taller baseline than |
| 1992 // the default font. | 1994 // the default font. |
| 1993 textfield_->SetText(UTF8ToUTF16("\xE0\xB9\x91")); | 1995 textfield_->SetText(UTF8ToUTF16("\xE0\xB9\x91")); |
| 1994 const int new_baseline = textfield_->GetBaseline(); | 1996 const int new_baseline = textfield_->GetBaseline(); |
| 1995 | 1997 |
| 1996 // Regardless of the text, the baseline must be the same. | 1998 // Regardless of the text, the baseline must be the same. |
| 1997 EXPECT_EQ(new_baseline, old_baseline); | 1999 EXPECT_EQ(new_baseline, old_baseline); |
| 1998 } | 2000 } |
| 1999 | 2001 |
| 2000 } // namespace views | 2002 } // namespace views |
| OLD | NEW |