| 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" |
| 11 #include "chrome/browser/status_icons/status_icon.h" | 11 #include "chrome/browser/status_icons/status_icon.h" |
| 12 #include "chrome/browser/status_icons/status_tray.h" | 12 #include "chrome/browser/status_icons/status_tray.h" |
| 13 #include "chrome/browser/ui/views/message_center/notification_bubble_wrapper.h" | 13 #include "chrome/browser/ui/views/message_center/notification_bubble_wrapper.h" |
| 14 #include "content/public/browser/notification_service.h" |
| 14 #include "content/public/browser/user_metrics.h" | 15 #include "content/public/browser/user_metrics.h" |
| 15 #include "grit/chromium_strings.h" | 16 #include "grit/chromium_strings.h" |
| 16 #include "grit/theme_resources.h" | 17 #include "grit/theme_resources.h" |
| 17 #include "grit/ui_strings.h" | 18 #include "grit/ui_strings.h" |
| 18 #include "ui/base/l10n/l10n_util.h" | 19 #include "ui/base/l10n/l10n_util.h" |
| 19 #include "ui/base/models/simple_menu_model.h" | 20 #include "ui/base/models/simple_menu_model.h" |
| 20 #include "ui/base/resource/resource_bundle.h" | 21 #include "ui/base/resource/resource_bundle.h" |
| 21 #include "ui/gfx/canvas.h" | 22 #include "ui/gfx/canvas.h" |
| 22 #include "ui/gfx/image/image_skia_operations.h" | 23 #include "ui/gfx/image/image_skia_operations.h" |
| 23 #include "ui/gfx/rect.h" | 24 #include "ui/gfx/rect.h" |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 } | 261 } |
| 261 | 262 |
| 262 void WebNotificationTray::HideBubbleWithView( | 263 void WebNotificationTray::HideBubbleWithView( |
| 263 const views::TrayBubbleView* bubble_view) { | 264 const views::TrayBubbleView* bubble_view) { |
| 264 if (message_center_bubble_.get() && | 265 if (message_center_bubble_.get() && |
| 265 bubble_view == message_center_bubble_->bubble_view()) { | 266 bubble_view == message_center_bubble_->bubble_view()) { |
| 266 message_center_tray_->HideMessageCenterBubble(); | 267 message_center_tray_->HideMessageCenterBubble(); |
| 267 } | 268 } |
| 268 } | 269 } |
| 269 | 270 |
| 271 MessageCenterTray* WebNotificationTray::GetMessageCenterTray() { |
| 272 return message_center_tray_.get(); |
| 273 } |
| 274 |
| 270 StatusIcon* WebNotificationTray::GetStatusIcon() { | 275 StatusIcon* WebNotificationTray::GetStatusIcon() { |
| 271 if (status_icon_) | 276 if (status_icon_) |
| 272 return status_icon_; | 277 return status_icon_; |
| 273 | 278 |
| 274 StatusTray* status_tray = g_browser_process->status_tray(); | 279 StatusTray* status_tray = g_browser_process->status_tray(); |
| 275 if (!status_tray) | 280 if (!status_tray) |
| 276 return NULL; | 281 return NULL; |
| 277 | 282 |
| 278 StatusIcon* status_icon = status_tray->CreateStatusIcon(); | 283 StatusIcon* status_icon = status_tray->CreateStatusIcon(); |
| 279 if (!status_icon) | 284 if (!status_icon) |
| (...skipping 24 matching lines...) Expand all Loading... |
| 304 | 309 |
| 305 message_center::MessageCenterBubble* | 310 message_center::MessageCenterBubble* |
| 306 WebNotificationTray::GetMessageCenterBubbleForTest() { | 311 WebNotificationTray::GetMessageCenterBubbleForTest() { |
| 307 if (!message_center_bubble_.get()) | 312 if (!message_center_bubble_.get()) |
| 308 return NULL; | 313 return NULL; |
| 309 return static_cast<message_center::MessageCenterBubble*>( | 314 return static_cast<message_center::MessageCenterBubble*>( |
| 310 message_center_bubble_->bubble()); | 315 message_center_bubble_->bubble()); |
| 311 } | 316 } |
| 312 | 317 |
| 313 } // namespace message_center | 318 } // namespace message_center |
| OLD | NEW |