Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(279)

Side by Side Diff: ash/system/chromeos/power/battery_notification.cc

Issue 1292003004: Elide origins displayed on web notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Style nit Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ash/system/chromeos/power/battery_notification.h" 5 #include "ash/system/chromeos/power/battery_notification.h"
6 6
7 #include "ash/system/chromeos/power/power_status.h" 7 #include "ash/system/chromeos/power/power_status.h"
8 #include "ash/system/system_notifier.h" 8 #include "ash/system/system_notifier.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 base::TimeDelta::FromMinutes(hour * 60 + min)); 73 base::TimeDelta::FromMinutes(hour * 60 + min));
74 } 74 }
75 } 75 }
76 76
77 if (!time_message.empty()) 77 if (!time_message.empty())
78 message = message + base::ASCIIToUTF16("\n") + time_message; 78 message = message + base::ASCIIToUTF16("\n") + time_message;
79 79
80 scoped_ptr<Notification> notification(new Notification( 80 scoped_ptr<Notification> notification(new Notification(
81 message_center::NOTIFICATION_TYPE_SIMPLE, kBatteryNotificationId, 81 message_center::NOTIFICATION_TYPE_SIMPLE, kBatteryNotificationId,
82 base::string16(), message, GetBatteryImage(notification_state), 82 base::string16(), message, GetBatteryImage(notification_state),
83 base::string16(), 83 base::string16(), GURL(),
84 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, 84 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT,
85 system_notifier::kNotifierBattery), 85 system_notifier::kNotifierBattery),
86 message_center::RichNotificationData(), NULL)); 86 message_center::RichNotificationData(), NULL));
87 notification->SetSystemPriority(); 87 notification->SetSystemPriority();
88 return notification; 88 return notification;
89 } 89 }
90 90
91 } // namespace 91 } // namespace
92 92
93 BatteryNotification::BatteryNotification( 93 BatteryNotification::BatteryNotification(
(...skipping 11 matching lines...) Expand all
105 105
106 void BatteryNotification::Update( 106 void BatteryNotification::Update(
107 TrayPower::NotificationState notification_state) { 107 TrayPower::NotificationState notification_state) {
108 if (message_center_->FindVisibleNotificationById(kBatteryNotificationId)) { 108 if (message_center_->FindVisibleNotificationById(kBatteryNotificationId)) {
109 message_center_->UpdateNotification( 109 message_center_->UpdateNotification(
110 kBatteryNotificationId, CreateNotification(notification_state).Pass()); 110 kBatteryNotificationId, CreateNotification(notification_state).Pass());
111 } 111 }
112 } 112 }
113 113
114 } // namespace ash 114 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/bluetooth/bluetooth_notification_controller.cc ('k') | ash/system/chromeos/power/tray_power.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698