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/tray_constants.h" | 9 #include "ash/system/tray/tray_constants.h" |
10 #include "ash/system/tray/tray_views.h" | 10 #include "ash/system/tray/tray_views.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 bool TrayAccessibility::GetInitialVisibility() { | 69 bool TrayAccessibility::GetInitialVisibility() { |
70 return Shell::GetInstance()->delegate() && | 70 return Shell::GetInstance()->delegate() && |
71 Shell::GetInstance()->delegate()->IsSpokenFeedbackEnabled(); | 71 Shell::GetInstance()->delegate()->IsSpokenFeedbackEnabled(); |
72 } | 72 } |
73 | 73 |
74 views::View* TrayAccessibility::CreateDefaultView(user::LoginStatus status) { | 74 views::View* TrayAccessibility::CreateDefaultView(user::LoginStatus status) { |
75 if (!Shell::GetInstance()->delegate()->IsSpokenFeedbackEnabled()) | 75 if (!Shell::GetInstance()->delegate()->IsSpokenFeedbackEnabled()) |
76 return NULL; | 76 return NULL; |
77 | 77 |
78 DCHECK(string_id_); | |
79 CHECK(default_ == NULL); | 78 CHECK(default_ == NULL); |
80 default_ = new DefaultAccessibilityView(); | 79 default_ = new DefaultAccessibilityView(); |
81 | 80 |
82 return default_; | 81 return default_; |
83 } | 82 } |
84 | 83 |
85 views::View* TrayAccessibility::CreateDetailedView(user::LoginStatus status) { | 84 views::View* TrayAccessibility::CreateDetailedView(user::LoginStatus status) { |
86 DCHECK(string_id_); | 85 DCHECK(string_id_); |
87 CHECK(detailed_ == NULL); | 86 CHECK(detailed_ == NULL); |
88 detailed_ = new views::View; | 87 detailed_ = new views::View; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 string_id_ = string_id; | 119 string_id_ = string_id; |
121 PopupDetailedView(kTrayPopupAutoCloseDelayForTextInSeconds, false); | 120 PopupDetailedView(kTrayPopupAutoCloseDelayForTextInSeconds, false); |
122 } else if (detailed_) { | 121 } else if (detailed_) { |
123 string_id_ = 0; | 122 string_id_ = 0; |
124 detailed_->GetWidget()->Close(); | 123 detailed_->GetWidget()->Close(); |
125 } | 124 } |
126 } | 125 } |
127 | 126 |
128 } // namespace internal | 127 } // namespace internal |
129 } // namespace ash | 128 } // namespace ash |
OLD | NEW |