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 bubble_view() | 110 DCHECK(bubble_view()->GetFocusManager()); |
111 views::View* next_focusable_view = bubble_view() | |
111 ->GetFocusManager() | 112 ->GetFocusManager() |
112 ->GetNextFocusableView(nullptr, nullptr, false, false) | 113 ->GetNextFocusableView(nullptr, nullptr, false, false); |
stevenjb
2016/07/07 16:57:12
If we are going to DCHECK on bubble_view()->GetFoc
yoshiki
2016/07/11 18:19:48
Done.
| |
113 ->RequestFocus(); | 114 if (next_focusable_view) |
stevenjb
2016/07/07 16:57:12
Add a comment explaining why next_focusable_view m
yoshiki
2016/07/11 18:19:48
Done.
| |
115 next_focusable_view->RequestFocus(); | |
114 } | 116 } |
115 | 117 |
116 void MessageCenterBubble::OnBubbleViewDestroyed() { | 118 void MessageCenterBubble::OnBubbleViewDestroyed() { |
117 message_center_view_ = NULL; | 119 message_center_view_ = NULL; |
118 } | 120 } |
119 | 121 |
120 void MessageCenterBubble::UpdateBubbleView() { | 122 void MessageCenterBubble::UpdateBubbleView() { |
121 if (!bubble_view()) | 123 if (!bubble_view()) |
122 return; // Could get called after view is closed | 124 return; // Could get called after view is closed |
123 const NotificationList::Notifications& notifications = | 125 const NotificationList::Notifications& notifications = |
(...skipping 14 matching lines...) Expand all Loading... | |
138 } | 140 } |
139 | 141 |
140 void MessageCenterBubble::OnMouseExitedView() { | 142 void MessageCenterBubble::OnMouseExitedView() { |
141 } | 143 } |
142 | 144 |
143 size_t MessageCenterBubble::NumMessageViewsForTest() const { | 145 size_t MessageCenterBubble::NumMessageViewsForTest() const { |
144 return message_center_view_->NumMessageViewsForTest(); | 146 return message_center_view_->NumMessageViewsForTest(); |
145 } | 147 } |
146 | 148 |
147 } // namespace message_center | 149 } // namespace message_center |
OLD | NEW |