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/system_tray.h" | 5 #include "ash/system/tray/system_tray.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/metrics/user_metrics_recorder.h" | 8 #include "ash/metrics/user_metrics_recorder.h" |
9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 DCHECK(anchor); | 91 DCHECK(anchor); |
92 user::LoginStatus login_status = | 92 user::LoginStatus login_status = |
93 Shell::GetInstance()->system_tray_delegate()->GetUserLoginStatus(); | 93 Shell::GetInstance()->system_tray_delegate()->GetUserLoginStatus(); |
94 bubble_->InitView(anchor, login_status, init_params); | 94 bubble_->InitView(anchor, login_status, init_params); |
95 bubble_wrapper_.reset(new TrayBubbleWrapper(tray, bubble_->bubble_view())); | 95 bubble_wrapper_.reset(new TrayBubbleWrapper(tray, bubble_->bubble_view())); |
96 // The system bubble should not have an arrow. | 96 // The system bubble should not have an arrow. |
97 bubble_->bubble_view()->SetArrowPaintType( | 97 bubble_->bubble_view()->SetArrowPaintType( |
98 views::BubbleBorder::PAINT_NONE); | 98 views::BubbleBorder::PAINT_NONE); |
99 is_persistent_ = is_persistent; | 99 is_persistent_ = is_persistent; |
100 | 100 |
101 // If ChromeVox is enabled, focus the default item if no item is focused. | 101 // If ChromeVox is enabled, focus the default item if no item is focused and |
102 if (Shell::GetInstance()->accessibility_delegate()-> | 102 // there isn't a delayed close. |
103 IsSpokenFeedbackEnabled()) { | 103 if (Shell::GetInstance() |
| 104 ->accessibility_delegate() |
| 105 ->IsSpokenFeedbackEnabled() && |
| 106 !is_persistent) { |
104 bubble_->FocusDefaultIfNeeded(); | 107 bubble_->FocusDefaultIfNeeded(); |
105 } | 108 } |
106 } | 109 } |
107 | 110 |
108 // Convenience accessors: | 111 // Convenience accessors: |
109 SystemTrayBubble* bubble() const { return bubble_.get(); } | 112 SystemTrayBubble* bubble() const { return bubble_.get(); } |
110 SystemTrayBubble::BubbleType bubble_type() const { | 113 SystemTrayBubble::BubbleType bubble_type() const { |
111 return bubble_->bubble_type(); | 114 return bubble_->bubble_type(); |
112 } | 115 } |
113 TrayBubbleView* bubble_view() const { return bubble_->bubble_view(); } | 116 TrayBubbleView* bubble_view() const { return bubble_->bubble_view(); } |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 system_bubble_.reset(); | 733 system_bubble_.reset(); |
731 // When closing a system bubble with the alternate shelf layout, we need to | 734 // When closing a system bubble with the alternate shelf layout, we need to |
732 // turn off the active tinting of the shelf. | 735 // turn off the active tinting of the shelf. |
733 if (full_system_tray_menu_) { | 736 if (full_system_tray_menu_) { |
734 SetDrawBackgroundAsActive(false); | 737 SetDrawBackgroundAsActive(false); |
735 full_system_tray_menu_ = false; | 738 full_system_tray_menu_ = false; |
736 } | 739 } |
737 } | 740 } |
738 | 741 |
739 } // namespace ash | 742 } // namespace ash |
OLD | NEW |