| 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" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 set_allow_deactivate_on_esc(true); | 50 set_allow_deactivate_on_esc(true); |
| 51 } | 51 } |
| 52 | 52 |
| 53 TestBarView::~TestBarView() {} | 53 TestBarView::~TestBarView() {} |
| 54 | 54 |
| 55 void TestBarView::ButtonPressed(Button* sender, const ui::Event& event) { | 55 void TestBarView::ButtonPressed(Button* sender, const ui::Event& event) { |
| 56 } | 56 } |
| 57 | 57 |
| 58 void TestBarView::Init() { | 58 void TestBarView::Init() { |
| 59 SetLayoutManager(new FillLayout()); | 59 SetLayoutManager(new FillLayout()); |
| 60 string16 label; | 60 base::string16 label; |
| 61 child_button_.reset(new LabelButton(this, label)); | 61 child_button_.reset(new LabelButton(this, label)); |
| 62 AddChildView(child_button_.get()); | 62 AddChildView(child_button_.get()); |
| 63 second_child_button_.reset(new LabelButton(this, label)); | 63 second_child_button_.reset(new LabelButton(this, label)); |
| 64 AddChildView(second_child_button_.get()); | 64 AddChildView(second_child_button_.get()); |
| 65 third_child_button_.reset(new LabelButton(this, label)); | 65 third_child_button_.reset(new LabelButton(this, label)); |
| 66 AddChildView(third_child_button_.get()); | 66 AddChildView(third_child_button_.get()); |
| 67 not_child_button_.reset(new LabelButton(this, label)); | 67 not_child_button_.reset(new LabelButton(this, label)); |
| 68 } | 68 } |
| 69 | 69 |
| 70 View* TestBarView::GetDefaultFocusableChild() { | 70 View* TestBarView::GetDefaultFocusableChild() { |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 test_view->GetWidget()->GetFocusManager()->GetFocusedView()); | 217 test_view->GetWidget()->GetFocusManager()->GetFocusedView()); |
| 218 | 218 |
| 219 // ESC | 219 // ESC |
| 220 test_view->AcceleratorPressed(test_view->escape_key()); | 220 test_view->AcceleratorPressed(test_view->escape_key()); |
| 221 EXPECT_EQ(original_test_view->third_child_button(), | 221 EXPECT_EQ(original_test_view->third_child_button(), |
| 222 test_view->GetWidget()->GetFocusManager()->GetFocusedView()); | 222 test_view->GetWidget()->GetFocusManager()->GetFocusedView()); |
| 223 widget->CloseNow(); | 223 widget->CloseNow(); |
| 224 widget.reset(); | 224 widget.reset(); |
| 225 } | 225 } |
| 226 } // namespace views | 226 } // namespace views |
| OLD | NEW |