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/label_button.h" | 8 #include "ui/views/controls/button/label_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" |
11 #include "ui/views/widget/widget.h" | 11 #include "ui/views/widget/widget.h" |
12 | 12 |
13 namespace views { | 13 namespace views { |
14 | 14 |
15 // TODO(alicet): bring pane rotation into views and add tests. | 15 // TODO(alicet): bring pane rotation into views and add tests. |
16 // See browser_view.cc for details. | 16 // See browser_view.cc for details. |
17 | 17 |
18 typedef ViewsTestBase AccessiblePaneViewTest; | 18 typedef ViewsTestBase AccessiblePaneViewTest; |
19 | 19 |
20 class TestBarView : public AccessiblePaneView, | 20 class TestBarView : public AccessiblePaneView, |
21 public ButtonListener { | 21 public ButtonListener { |
22 public: | 22 public: |
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 LabelButton* child_button() const { return child_button_.get(); } | 28 LabelButton* child_button() const { return child_button_.get(); } |
29 LabelButton* second_child_button() const { | 29 LabelButton* second_child_button() const { |
30 return second_child_button_.get(); | 30 return second_child_button_.get(); |
31 } | 31 } |
32 LabelButton* third_child_button() const { return third_child_button_.get(); } | 32 LabelButton* third_child_button() const { return third_child_button_.get(); } |
33 LabelButton* not_child_button() const { return not_child_button_.get(); } | 33 LabelButton* not_child_button() const { return not_child_button_.get(); } |
34 | 34 |
35 virtual View* GetDefaultFocusableChild() OVERRIDE; | 35 virtual View* GetDefaultFocusableChild() override; |
36 | 36 |
37 private: | 37 private: |
38 void Init(); | 38 void Init(); |
39 | 39 |
40 scoped_ptr<LabelButton> child_button_; | 40 scoped_ptr<LabelButton> child_button_; |
41 scoped_ptr<LabelButton> second_child_button_; | 41 scoped_ptr<LabelButton> second_child_button_; |
42 scoped_ptr<LabelButton> third_child_button_; | 42 scoped_ptr<LabelButton> third_child_button_; |
43 scoped_ptr<LabelButton> not_child_button_; | 43 scoped_ptr<LabelButton> not_child_button_; |
44 | 44 |
45 DISALLOW_COPY_AND_ASSIGN(TestBarView); | 45 DISALLOW_COPY_AND_ASSIGN(TestBarView); |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 test_view->GetWidget()->GetFocusManager()->GetFocusedView()); | 215 test_view->GetWidget()->GetFocusManager()->GetFocusedView()); |
216 | 216 |
217 // ESC | 217 // ESC |
218 test_view->AcceleratorPressed(test_view->escape_key()); | 218 test_view->AcceleratorPressed(test_view->escape_key()); |
219 EXPECT_EQ(original_test_view->third_child_button(), | 219 EXPECT_EQ(original_test_view->third_child_button(), |
220 test_view->GetWidget()->GetFocusManager()->GetFocusedView()); | 220 test_view->GetWidget()->GetFocusManager()->GetFocusedView()); |
221 widget->CloseNow(); | 221 widget->CloseNow(); |
222 widget.reset(); | 222 widget.reset(); |
223 } | 223 } |
224 } // namespace views | 224 } // namespace views |
OLD | NEW |