| 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 "ui/views/focus/focus_manager.h" | 5 #include "ui/views/focus/focus_manager.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 | 519 |
| 520 private: | 520 private: |
| 521 DtorTrackVector* dtor_tracker_; | 521 DtorTrackVector* dtor_tracker_; |
| 522 DISALLOW_COPY_AND_ASSIGN(TestFocusManagerFactory); | 522 DISALLOW_COPY_AND_ASSIGN(TestFocusManagerFactory); |
| 523 }; | 523 }; |
| 524 | 524 |
| 525 class LabelButtonDtorTracked : public LabelButton { | 525 class LabelButtonDtorTracked : public LabelButton { |
| 526 public: | 526 public: |
| 527 LabelButtonDtorTracked(const base::string16& text, | 527 LabelButtonDtorTracked(const base::string16& text, |
| 528 DtorTrackVector* dtor_tracker) | 528 DtorTrackVector* dtor_tracker) |
| 529 : LabelButton(NULL, text), | 529 : LabelButton(nullptr), dtor_tracker_(dtor_tracker) { |
| 530 dtor_tracker_(dtor_tracker) { | 530 InitAsButton(text); |
| 531 SetStyle(STYLE_BUTTON); | |
| 532 }; | 531 }; |
| 533 ~LabelButtonDtorTracked() override { | 532 ~LabelButtonDtorTracked() override { |
| 534 dtor_tracker_->push_back("LabelButtonDtorTracked"); | 533 dtor_tracker_->push_back("LabelButtonDtorTracked"); |
| 535 } | 534 } |
| 536 | 535 |
| 537 DtorTrackVector* dtor_tracker_; | 536 DtorTrackVector* dtor_tracker_; |
| 538 }; | 537 }; |
| 539 | 538 |
| 540 class WindowDtorTracked : public Widget { | 539 class WindowDtorTracked : public Widget { |
| 541 public: | 540 public: |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 EXPECT_EQ(view1, GetFocusManager()->GetFocusedView()); | 870 EXPECT_EQ(view1, GetFocusManager()->GetFocusedView()); |
| 872 | 871 |
| 873 // Allow focus to go to the parent, and focus backwards which should now move | 872 // Allow focus to go to the parent, and focus backwards which should now move |
| 874 // up |widget_view| (in the parent). | 873 // up |widget_view| (in the parent). |
| 875 delegate->set_should_advance_focus_to_parent(true); | 874 delegate->set_should_advance_focus_to_parent(true); |
| 876 GetFocusManager()->AdvanceFocus(true); | 875 GetFocusManager()->AdvanceFocus(true); |
| 877 EXPECT_EQ(widget_view, GetFocusManager()->GetFocusedView()); | 876 EXPECT_EQ(widget_view, GetFocusManager()->GetFocusedView()); |
| 878 } | 877 } |
| 879 | 878 |
| 880 } // namespace views | 879 } // namespace views |
| OLD | NEW |