OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <utility> | 5 #include <utility> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "ui/base/accelerators/accelerator.h" | 9 #include "ui/base/accelerators/accelerator.h" |
10 #include "ui/events/keycodes/keyboard_codes.h" | 10 #include "ui/events/keycodes/keyboard_codes.h" |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 return new FocusManagerDtorTracked(widget, dtor_tracker_); | 530 return new FocusManagerDtorTracked(widget, dtor_tracker_); |
531 } | 531 } |
532 | 532 |
533 private: | 533 private: |
534 DtorTrackVector* dtor_tracker_; | 534 DtorTrackVector* dtor_tracker_; |
535 DISALLOW_COPY_AND_ASSIGN(TestFocusManagerFactory); | 535 DISALLOW_COPY_AND_ASSIGN(TestFocusManagerFactory); |
536 }; | 536 }; |
537 | 537 |
538 class LabelButtonDtorTracked : public LabelButton { | 538 class LabelButtonDtorTracked : public LabelButton { |
539 public: | 539 public: |
540 LabelButtonDtorTracked(const string16& text, DtorTrackVector* dtor_tracker) | 540 LabelButtonDtorTracked(const base::string16& text, |
| 541 DtorTrackVector* dtor_tracker) |
541 : LabelButton(NULL, text), | 542 : LabelButton(NULL, text), |
542 dtor_tracker_(dtor_tracker) { | 543 dtor_tracker_(dtor_tracker) { |
543 SetStyle(STYLE_NATIVE_TEXTBUTTON); | 544 SetStyle(STYLE_NATIVE_TEXTBUTTON); |
544 }; | 545 }; |
545 virtual ~LabelButtonDtorTracked() { | 546 virtual ~LabelButtonDtorTracked() { |
546 dtor_tracker_->push_back("LabelButtonDtorTracked"); | 547 dtor_tracker_->push_back("LabelButtonDtorTracked"); |
547 } | 548 } |
548 | 549 |
549 DtorTrackVector* dtor_tracker_; | 550 DtorTrackVector* dtor_tracker_; |
550 }; | 551 }; |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
904 EXPECT_EQ(view1, GetFocusManager()->GetFocusedView()); | 905 EXPECT_EQ(view1, GetFocusManager()->GetFocusedView()); |
905 | 906 |
906 // Allow focus to go to the parent, and focus backwards which should now move | 907 // Allow focus to go to the parent, and focus backwards which should now move |
907 // up |widget_view| (in the parent). | 908 // up |widget_view| (in the parent). |
908 delegate->set_should_advance_focus_to_parent(true); | 909 delegate->set_should_advance_focus_to_parent(true); |
909 GetFocusManager()->AdvanceFocus(true); | 910 GetFocusManager()->AdvanceFocus(true); |
910 EXPECT_EQ(widget_view, GetFocusManager()->GetFocusedView()); | 911 EXPECT_EQ(widget_view, GetFocusManager()->GetFocusedView()); |
911 } | 912 } |
912 | 913 |
913 } // namespace views | 914 } // namespace views |
OLD | NEW |