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 #include "ash/test/ash_test_helper.h" |
5 #include "ash/test/ash_test_views_delegate.h" | 6 #include "ash/test/ash_test_views_delegate.h" |
6 | 7 |
7 #include "ash/shell.h" | 8 #include "ash/shell.h" |
8 | 9 |
9 namespace ash { | 10 namespace ash { |
10 namespace test { | 11 namespace test { |
11 | 12 |
12 AshTestViewsDelegate::AshTestViewsDelegate() {} | 13 AshTestViewsDelegate::AshTestViewsDelegate() {} |
13 | 14 |
14 AshTestViewsDelegate::~AshTestViewsDelegate() {} | 15 AshTestViewsDelegate::~AshTestViewsDelegate() {} |
15 | 16 |
16 void AshTestViewsDelegate::OnBeforeWidgetInit( | 17 void AshTestViewsDelegate::OnBeforeWidgetInit( |
17 views::Widget::InitParams* params, | 18 views::Widget::InitParams* params, |
18 views::internal::NativeWidgetDelegate* delegate) { | 19 views::internal::NativeWidgetDelegate* delegate) { |
19 TestViewsDelegate::OnBeforeWidgetInit(params, delegate); | 20 TestViewsDelegate::OnBeforeWidgetInit(params, delegate); |
20 | 21 |
21 if (!params->parent && !params->context && ash::Shell::HasInstance()) { | 22 if (!params->parent && !params->context && ash::Shell::HasInstance()) { |
22 // If the window has neither a parent nor a context add to the root. | 23 // If the window has neither a parent nor a context add to the root. |
23 params->parent = ash::Shell::GetInstance()->GetPrimaryRootWindow(); | 24 params->parent = ash::Shell::GetInstance()->GetPrimaryRootWindow(); |
24 } | 25 } |
25 } | 26 } |
26 | 27 |
| 28 void AshTestViewsDelegate::NotifyAccessibilityEvent(views::View* view, |
| 29 ui::AXEvent event_type) { |
| 30 TestViewsDelegate::NotifyAccessibilityEvent(view, event_type); |
| 31 |
| 32 if (test_accessibility_event_delegate_) { |
| 33 test_accessibility_event_delegate_->NotifyAccessibilityEvent(view, |
| 34 event_type); |
| 35 } |
| 36 } |
| 37 |
27 } // namespace test | 38 } // namespace test |
28 } // namespace ash | 39 } // namespace ash |
OLD | NEW |