| 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/accessible_pane_view.h" | 5 #include "ui/views/accessible_pane_view.h" |
| 6 | 6 |
| 7 #include "ui/base/accelerators/accelerator.h" | 7 #include "ui/base/accelerators/accelerator.h" |
| 8 #include "ui/views/controls/button/text_button.h" | 8 #include "ui/views/controls/button/text_button.h" |
| 9 #include "ui/views/layout/fill_layout.h" | 9 #include "ui/views/layout/fill_layout.h" |
| 10 #include "ui/views/test/views_test_base.h" | 10 #include "ui/views/test/views_test_base.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 TestBarView(); | 23 TestBarView(); |
| 24 virtual ~TestBarView(); | 24 virtual ~TestBarView(); |
| 25 | 25 |
| 26 virtual void ButtonPressed(Button* sender, | 26 virtual void ButtonPressed(Button* sender, |
| 27 const ui::Event& event) OVERRIDE; | 27 const ui::Event& event) OVERRIDE; |
| 28 TextButton* child_button() const { return child_button_.get(); } | 28 TextButton* child_button() const { return child_button_.get(); } |
| 29 TextButton* second_child_button() const { return second_child_button_.get(); } | 29 TextButton* second_child_button() const { return second_child_button_.get(); } |
| 30 TextButton* third_child_button() const { return third_child_button_.get(); } | 30 TextButton* third_child_button() const { return third_child_button_.get(); } |
| 31 TextButton* not_child_button() const { return not_child_button_.get(); } | 31 TextButton* not_child_button() const { return not_child_button_.get(); } |
| 32 | 32 |
| 33 const ui::Accelerator& home_key() const { return home_key_; } | |
| 34 const ui::Accelerator& end_key() const { return end_key_; } | |
| 35 const ui::Accelerator& escape_key() const { return escape_key_; } | |
| 36 const ui::Accelerator& left_key() const { return left_key_; } | |
| 37 const ui::Accelerator& right_key() const { return right_key_; } | |
| 38 | |
| 39 virtual View* GetDefaultFocusableChild() OVERRIDE; | 33 virtual View* GetDefaultFocusableChild() OVERRIDE; |
| 40 | 34 |
| 41 private: | 35 private: |
| 42 void Init(); | 36 void Init(); |
| 43 | 37 |
| 44 scoped_ptr<TextButton> child_button_; | 38 scoped_ptr<TextButton> child_button_; |
| 45 scoped_ptr<TextButton> second_child_button_; | 39 scoped_ptr<TextButton> second_child_button_; |
| 46 scoped_ptr<TextButton> third_child_button_; | 40 scoped_ptr<TextButton> third_child_button_; |
| 47 scoped_ptr<TextButton> not_child_button_; | 41 scoped_ptr<TextButton> not_child_button_; |
| 48 | 42 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 test_view->GetWidget()->GetFocusManager()->GetFocusedView()); | 166 test_view->GetWidget()->GetFocusManager()->GetFocusedView()); |
| 173 | 167 |
| 174 // ESC | 168 // ESC |
| 175 test_view->AcceleratorPressed(test_view->escape_key()); | 169 test_view->AcceleratorPressed(test_view->escape_key()); |
| 176 EXPECT_EQ(original_test_view->third_child_button(), | 170 EXPECT_EQ(original_test_view->third_child_button(), |
| 177 test_view->GetWidget()->GetFocusManager()->GetFocusedView()); | 171 test_view->GetWidget()->GetFocusManager()->GetFocusedView()); |
| 178 widget->CloseNow(); | 172 widget->CloseNow(); |
| 179 widget.reset(); | 173 widget.reset(); |
| 180 } | 174 } |
| 181 } // namespace views | 175 } // namespace views |
| OLD | NEW |