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 "ui/message_center/views/message_center_bubble.h" | 5 #include "ui/message_center/views/message_center_bubble.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "ui/base/l10n/l10n_util.h" | 8 #include "ui/base/l10n/l10n_util.h" |
9 #include "ui/message_center/message_center_style.h" | 9 #include "ui/message_center/message_center_style.h" |
10 #include "ui/message_center/views/message_center_view.h" | 10 #include "ui/message_center/views/message_center_view.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 message_center_view_ = new MessageCenterView( | 100 message_center_view_ = new MessageCenterView( |
101 message_center(), tray(), max_height(), initially_settings_visible_, | 101 message_center(), tray(), max_height(), initially_settings_visible_, |
102 false); /* MessageCenterBubble should be used only on ChromeOS. | 102 false); /* MessageCenterBubble should be used only on ChromeOS. |
103 Message center is never shown top down in ChromeOS. */ | 103 Message center is never shown top down in ChromeOS. */ |
104 bubble_view()->AddChildView(new ContentsView(this, message_center_view_)); | 104 bubble_view()->AddChildView(new ContentsView(this, message_center_view_)); |
105 // Resize the content of the bubble view to the given bubble size. This is | 105 // Resize the content of the bubble view to the given bubble size. This is |
106 // necessary in case of the bubble border forcing a bigger size then the | 106 // necessary in case of the bubble border forcing a bigger size then the |
107 // |new_bubble_view| actually wants. See crbug.com/169390. | 107 // |new_bubble_view| actually wants. See crbug.com/169390. |
108 bubble_view()->Layout(); | 108 bubble_view()->Layout(); |
109 UpdateBubbleView(); | 109 UpdateBubbleView(); |
110 views::FocusManager* focus_manager = bubble_view()->GetFocusManager(); | |
111 // new_bubble_view should be a top level view and have a focus manager. | |
112 DCHECK(focus_manager); | |
113 views::View* next_focusable_view = focus_manager | |
114 ->GetNextFocusableView(nullptr, nullptr, false, false); | |
115 // The bubble may not have any focusable view (eg. on lock screen). In such | |
116 // case, |next_focusable_view| is null. | |
117 if (next_focusable_view) | |
118 next_focusable_view->RequestFocus(); | |
stevenjb
2016/08/26 17:00:59
I assume that when this is removed, 'tab' still fo
afakhry
2016/08/26 18:04:09
Yes, correct.
| |
119 } | 110 } |
120 | 111 |
121 void MessageCenterBubble::OnBubbleViewDestroyed() { | 112 void MessageCenterBubble::OnBubbleViewDestroyed() { |
122 message_center_view_ = NULL; | 113 message_center_view_ = NULL; |
123 } | 114 } |
124 | 115 |
125 void MessageCenterBubble::UpdateBubbleView() { | 116 void MessageCenterBubble::UpdateBubbleView() { |
126 if (!bubble_view()) | 117 if (!bubble_view()) |
127 return; // Could get called after view is closed | 118 return; // Could get called after view is closed |
128 const NotificationList::Notifications& notifications = | 119 const NotificationList::Notifications& notifications = |
(...skipping 14 matching lines...) Expand all Loading... | |
143 } | 134 } |
144 | 135 |
145 void MessageCenterBubble::OnMouseExitedView() { | 136 void MessageCenterBubble::OnMouseExitedView() { |
146 } | 137 } |
147 | 138 |
148 size_t MessageCenterBubble::NumMessageViewsForTest() const { | 139 size_t MessageCenterBubble::NumMessageViewsForTest() const { |
149 return message_center_view_->NumMessageViewsForTest(); | 140 return message_center_view_->NumMessageViewsForTest(); |
150 } | 141 } |
151 | 142 |
152 } // namespace message_center | 143 } // namespace message_center |
OLD | NEW |