| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef ASH_TEST_ASH_TEST_VIEWS_DELEGATE_H_ | 5 #ifndef ASH_TEST_ASH_TEST_VIEWS_DELEGATE_H_ |
| 6 #define ASH_TEST_ASH_TEST_VIEWS_DELEGATE_H_ | 6 #define ASH_TEST_ASH_TEST_VIEWS_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "ui/views/test/test_views_delegate.h" | 9 #include "ui/views/test/test_views_delegate.h" |
| 10 | 10 |
| 11 namespace ash { | 11 namespace ash { |
| 12 namespace test { | 12 namespace test { |
| 13 | 13 |
| 14 class TestAccessibilityEventDelegate { |
| 15 public: |
| 16 TestAccessibilityEventDelegate() {} |
| 17 virtual ~TestAccessibilityEventDelegate() {} |
| 18 virtual void NotifyAccessibilityEvent(views::View* view, |
| 19 ui::AXEvent event_type) = 0; |
| 20 }; |
| 21 |
| 14 // Ash specific ViewsDelegate. In addition to creating a TestWebContents this | 22 // Ash specific ViewsDelegate. In addition to creating a TestWebContents this |
| 15 // parents widget with no parent/context to the shell. This is created by | 23 // parents widget with no parent/context to the shell. This is created by |
| 16 // default AshTestHelper. | 24 // default AshTestHelper. |
| 17 class AshTestViewsDelegate : public views::TestViewsDelegate { | 25 class AshTestViewsDelegate : public views::TestViewsDelegate { |
| 18 public: | 26 public: |
| 19 AshTestViewsDelegate(); | 27 AshTestViewsDelegate(); |
| 20 ~AshTestViewsDelegate() override; | 28 ~AshTestViewsDelegate() override; |
| 21 | 29 |
| 30 // Not owned. |
| 31 void set_test_accessibility_event_delegate( |
| 32 TestAccessibilityEventDelegate* test_accessibility_event_delegate) { |
| 33 test_accessibility_event_delegate_ = test_accessibility_event_delegate; |
| 34 } |
| 35 |
| 22 // Overriden from TestViewsDelegate. | 36 // Overriden from TestViewsDelegate. |
| 23 void OnBeforeWidgetInit( | 37 void OnBeforeWidgetInit( |
| 24 views::Widget::InitParams* params, | 38 views::Widget::InitParams* params, |
| 25 views::internal::NativeWidgetDelegate* delegate) override; | 39 views::internal::NativeWidgetDelegate* delegate) override; |
| 40 void NotifyAccessibilityEvent(views::View* view, |
| 41 ui::AXEvent event_type) override; |
| 26 | 42 |
| 27 private: | 43 private: |
| 44 // Not owned. |
| 45 TestAccessibilityEventDelegate* test_accessibility_event_delegate_ = nullptr; |
| 46 |
| 28 DISALLOW_COPY_AND_ASSIGN(AshTestViewsDelegate); | 47 DISALLOW_COPY_AND_ASSIGN(AshTestViewsDelegate); |
| 29 }; | 48 }; |
| 30 | 49 |
| 31 } // namespace test | 50 } // namespace test |
| 32 } // namespace ash | 51 } // namespace ash |
| 33 | 52 |
| 34 #endif // ASH_TEST_ASH_TEST_VIEWS_DELEGATE_H_ | 53 #endif // ASH_TEST_ASH_TEST_VIEWS_DELEGATE_H_ |
| OLD | NEW |