Chromium Code Reviews| 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/textfield.h" | 5 #include "ui/views/controls/textfield/textfield.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 323 target_->set_controller(this); | 323 target_->set_controller(this); |
| 324 } | 324 } |
| 325 | 325 |
| 326 views::Textfield* target() { return target_.get(); } | 326 views::Textfield* target() { return target_.get(); } |
| 327 | 327 |
| 328 // views::TextfieldController: | 328 // views::TextfieldController: |
| 329 bool HandleKeyEvent(views::Textfield* sender, | 329 bool HandleKeyEvent(views::Textfield* sender, |
| 330 const ui::KeyEvent& key_event) override { | 330 const ui::KeyEvent& key_event) override { |
| 331 if (target_) | 331 if (target_) |
| 332 target_->OnBlur(); | 332 target_->OnBlur(); |
| 333 target_->parent()->RemoveChildView(target_.get()); | |
|
tapted
2016/10/27 00:53:42
This needs a comment (if it's still needed) - the
Patti Lor
2016/10/30 23:26:04
I added a comment, please let me know if it makes
| |
| 333 target_.reset(); | 334 target_.reset(); |
| 334 return false; | 335 return false; |
| 335 } | 336 } |
| 336 | 337 |
| 337 private: | 338 private: |
| 338 std::unique_ptr<views::Textfield> target_; | 339 std::unique_ptr<views::Textfield> target_; |
| 339 }; | 340 }; |
| 340 | 341 |
| 341 base::string16 GetClipboardText(ui::ClipboardType type) { | 342 base::string16 GetClipboardText(ui::ClipboardType type) { |
| 342 base::string16 text; | 343 base::string16 text; |
| (...skipping 2662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3005 | 3006 |
| 3006 textfield_->SetTextInputType(ui::TEXT_INPUT_TYPE_PASSWORD); | 3007 textfield_->SetTextInputType(ui::TEXT_INPUT_TYPE_PASSWORD); |
| 3007 ui::AXViewState state_protected; | 3008 ui::AXViewState state_protected; |
| 3008 textfield_->GetAccessibleState(&state_protected); | 3009 textfield_->GetAccessibleState(&state_protected); |
| 3009 EXPECT_EQ(ui::AX_ROLE_TEXT_FIELD, state_protected.role); | 3010 EXPECT_EQ(ui::AX_ROLE_TEXT_FIELD, state_protected.role); |
| 3010 EXPECT_EQ(ASCIIToUTF16("********"), state_protected.value); | 3011 EXPECT_EQ(ASCIIToUTF16("********"), state_protected.value); |
| 3011 EXPECT_TRUE(state_protected.HasStateFlag(ui::AX_STATE_PROTECTED)); | 3012 EXPECT_TRUE(state_protected.HasStateFlag(ui::AX_STATE_PROTECTED)); |
| 3012 } | 3013 } |
| 3013 | 3014 |
| 3014 } // namespace views | 3015 } // namespace views |
| OLD | NEW |