OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/views/message_center/web_notification_tray.h" | 5 #include "chrome/browser/ui/views/message_center/web_notification_tray.h" |
6 | 6 |
7 #include "base/i18n/number_formatting.h" | 7 #include "base/i18n/number_formatting.h" |
8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 message_center::MessageCenter* WebNotificationTray::message_center() { | 145 message_center::MessageCenter* WebNotificationTray::message_center() { |
146 return message_center_tray_->message_center(); | 146 return message_center_tray_->message_center(); |
147 } | 147 } |
148 | 148 |
149 bool WebNotificationTray::ShowPopups() { | 149 bool WebNotificationTray::ShowPopups() { |
150 popup_collection_.reset(new message_center::MessagePopupCollection( | 150 popup_collection_.reset(new message_center::MessagePopupCollection( |
151 NULL, message_center(), message_center_tray_.get(), false)); | 151 NULL, message_center(), message_center_tray_.get(), false)); |
152 return true; | 152 return true; |
153 } | 153 } |
154 | 154 |
155 void WebNotificationTray::HidePopups() { popup_collection_.reset(); } | 155 void WebNotificationTray::HidePopups() { |
| 156 DCHECK(popup_collection_.get()); |
| 157 |
| 158 popup_collection_->MarkAllPopupsShown(); |
| 159 popup_collection_.reset(); |
| 160 } |
156 | 161 |
157 bool WebNotificationTray::ShowMessageCenter() { | 162 bool WebNotificationTray::ShowMessageCenter() { |
158 message_center_delegate_ = | 163 message_center_delegate_ = |
159 new MessageCenterWidgetDelegate(this, | 164 new MessageCenterWidgetDelegate(this, |
160 message_center_tray_.get(), | 165 message_center_tray_.get(), |
161 false, // settings initally invisible | 166 false, // settings initally invisible |
162 GetPositionInfo()); | 167 GetPositionInfo()); |
163 | 168 |
164 return true; | 169 return true; |
165 } | 170 } |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 status_icon_menu_ = menu.get(); | 364 status_icon_menu_ = menu.get(); |
360 status_icon->SetContextMenu(menu.Pass()); | 365 status_icon->SetContextMenu(menu.Pass()); |
361 } | 366 } |
362 | 367 |
363 MessageCenterWidgetDelegate* | 368 MessageCenterWidgetDelegate* |
364 WebNotificationTray::GetMessageCenterWidgetDelegateForTest() { | 369 WebNotificationTray::GetMessageCenterWidgetDelegateForTest() { |
365 return message_center_delegate_; | 370 return message_center_delegate_; |
366 } | 371 } |
367 | 372 |
368 } // namespace message_center | 373 } // namespace message_center |
OLD | NEW |