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 "ash/system/tray_accessibility.h" | 5 #include "ash/system/tray_accessibility.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_delegate.h" | 8 #include "ash/shell_delegate.h" |
| 9 #include "ash/system/tray/system_tray.h" |
9 #include "ash/system/tray/tray_constants.h" | 10 #include "ash/system/tray/tray_constants.h" |
10 #include "ash/system/tray/tray_views.h" | 11 #include "ash/system/tray/tray_views.h" |
11 #include "grit/ash_resources.h" | 12 #include "grit/ash_resources.h" |
12 #include "grit/ash_strings.h" | 13 #include "grit/ash_strings.h" |
13 #include "ui/base/resource/resource_bundle.h" | 14 #include "ui/base/resource/resource_bundle.h" |
14 #include "ui/gfx/image/image.h" | 15 #include "ui/gfx/image/image.h" |
15 #include "ui/views/controls/image_view.h" | 16 #include "ui/views/controls/image_view.h" |
16 #include "ui/views/controls/label.h" | 17 #include "ui/views/controls/label.h" |
17 #include "ui/views/layout/box_layout.h" | 18 #include "ui/views/layout/box_layout.h" |
18 #include "ui/views/widget/widget.h" | 19 #include "ui/views/widget/widget.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 Shell::GetInstance()->delegate()->ToggleSpokenFeedback(); | 51 Shell::GetInstance()->delegate()->ToggleSpokenFeedback(); |
51 GetWidget()->Close(); | 52 GetWidget()->Close(); |
52 return true; | 53 return true; |
53 } | 54 } |
54 | 55 |
55 private: | 56 private: |
56 | 57 |
57 DISALLOW_COPY_AND_ASSIGN(DefaultAccessibilityView); | 58 DISALLOW_COPY_AND_ASSIGN(DefaultAccessibilityView); |
58 }; | 59 }; |
59 | 60 |
60 TrayAccessibility::TrayAccessibility() | 61 TrayAccessibility::TrayAccessibility(SystemTray* system_tray) |
61 : TrayImageItem(IDR_AURA_UBER_TRAY_ACCESSIBILITY), | 62 : TrayImageItem(system_tray, IDR_AURA_UBER_TRAY_ACCESSIBILITY), |
62 default_(NULL), | 63 default_(NULL), |
63 detailed_(NULL) { | 64 detailed_(NULL) { |
64 } | 65 } |
65 | 66 |
66 TrayAccessibility::~TrayAccessibility() {} | 67 TrayAccessibility::~TrayAccessibility() {} |
67 | 68 |
68 bool TrayAccessibility::GetInitialVisibility() { | 69 bool TrayAccessibility::GetInitialVisibility() { |
69 return Shell::GetInstance()->delegate() && | 70 return Shell::GetInstance()->delegate() && |
70 Shell::GetInstance()->delegate()->IsSpokenFeedbackEnabled(); | 71 Shell::GetInstance()->delegate()->IsSpokenFeedbackEnabled(); |
71 } | 72 } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 115 |
115 if (enabled) { | 116 if (enabled) { |
116 PopupDetailedView(kTrayPopupAutoCloseDelayForTextInSeconds, false); | 117 PopupDetailedView(kTrayPopupAutoCloseDelayForTextInSeconds, false); |
117 } else if (detailed_) { | 118 } else if (detailed_) { |
118 detailed_->GetWidget()->Close(); | 119 detailed_->GetWidget()->Close(); |
119 } | 120 } |
120 } | 121 } |
121 | 122 |
122 } // namespace internal | 123 } // namespace internal |
123 } // namespace ash | 124 } // namespace ash |
OLD | NEW |