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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 return new WebNotificationTray(); | 125 return new WebNotificationTray(); |
126 } | 126 } |
127 | 127 |
128 WebNotificationTray::WebNotificationTray() | 128 WebNotificationTray::WebNotificationTray() |
129 : message_center_delegate_(NULL), | 129 : message_center_delegate_(NULL), |
130 status_icon_(NULL), | 130 status_icon_(NULL), |
131 message_center_visible_(false), | 131 message_center_visible_(false), |
132 should_update_tray_content_(true) { | 132 should_update_tray_content_(true) { |
133 message_center_tray_.reset( | 133 message_center_tray_.reset( |
134 new MessageCenterTray(this, g_browser_process->message_center())); | 134 new MessageCenterTray(this, g_browser_process->message_center())); |
135 OnMessageCenterTrayChanged(); | |
136 } | 135 } |
137 | 136 |
138 WebNotificationTray::~WebNotificationTray() { | 137 WebNotificationTray::~WebNotificationTray() { |
139 // Reset this early so that delegated events during destruction don't cause | 138 // Reset this early so that delegated events during destruction don't cause |
140 // problems. | 139 // problems. |
141 message_center_tray_.reset(); | 140 message_center_tray_.reset(); |
142 DestroyStatusIcon(); | 141 DestroyStatusIcon(); |
143 } | 142 } |
144 | 143 |
145 message_center::MessageCenter* WebNotificationTray::message_center() { | 144 message_center::MessageCenter* WebNotificationTray::message_center() { |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 DCHECK(status_icon); | 326 DCHECK(status_icon); |
328 status_icon->SetContextMenu(message_center_tray_->CreateQuietModeMenu()); | 327 status_icon->SetContextMenu(message_center_tray_->CreateQuietModeMenu()); |
329 } | 328 } |
330 | 329 |
331 MessageCenterWidgetDelegate* | 330 MessageCenterWidgetDelegate* |
332 WebNotificationTray::GetMessageCenterWidgetDelegateForTest() { | 331 WebNotificationTray::GetMessageCenterWidgetDelegateForTest() { |
333 return message_center_delegate_; | 332 return message_center_delegate_; |
334 } | 333 } |
335 | 334 |
336 } // namespace message_center | 335 } // namespace message_center |
OLD | NEW |