| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/extensions/extension_storage_monitor.h" | 5 #include "chrome/browser/extensions/extension_storage_monitor.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 IDS_EXTENSION_STORAGE_MONITOR_BUTTON_UNINSTALL_APP : | 425 IDS_EXTENSION_STORAGE_MONITOR_BUTTON_UNINSTALL_APP : |
| 426 IDS_EXTENSION_STORAGE_MONITOR_BUTTON_UNINSTALL_EXTENSION))); | 426 IDS_EXTENSION_STORAGE_MONITOR_BUTTON_UNINSTALL_EXTENSION))); |
| 427 | 427 |
| 428 gfx::Image notification_image(image); | 428 gfx::Image notification_image(image); |
| 429 if (notification_image.IsEmpty()) { | 429 if (notification_image.IsEmpty()) { |
| 430 notification_image = | 430 notification_image = |
| 431 extension->is_app() ? gfx::Image(util::GetDefaultAppIcon()) | 431 extension->is_app() ? gfx::Image(util::GetDefaultAppIcon()) |
| 432 : gfx::Image(util::GetDefaultExtensionIcon()); | 432 : gfx::Image(util::GetDefaultExtensionIcon()); |
| 433 } | 433 } |
| 434 | 434 |
| 435 scoped_ptr<message_center::Notification> notification; | 435 std::unique_ptr<message_center::Notification> notification; |
| 436 notification.reset(new message_center::Notification( | 436 notification.reset(new message_center::Notification( |
| 437 message_center::NOTIFICATION_TYPE_SIMPLE, notification_id, | 437 message_center::NOTIFICATION_TYPE_SIMPLE, notification_id, |
| 438 l10n_util::GetStringUTF16(IDS_EXTENSION_STORAGE_MONITOR_TITLE), | 438 l10n_util::GetStringUTF16(IDS_EXTENSION_STORAGE_MONITOR_TITLE), |
| 439 l10n_util::GetStringFUTF16( | 439 l10n_util::GetStringFUTF16( |
| 440 IDS_EXTENSION_STORAGE_MONITOR_TEXT, | 440 IDS_EXTENSION_STORAGE_MONITOR_TEXT, |
| 441 base::UTF8ToUTF16(extension->name()), | 441 base::UTF8ToUTF16(extension->name()), |
| 442 base::Int64ToString16(current_usage / kMBytes)), | 442 base::Int64ToString16(current_usage / kMBytes)), |
| 443 notification_image, base::string16() /* display source */, GURL(), | 443 notification_image, base::string16() /* display source */, GURL(), |
| 444 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, | 444 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, |
| 445 kSystemNotifierId), | 445 kSystemNotifierId), |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 void ExtensionStorageMonitor::SetStorageNotificationEnabled( | 653 void ExtensionStorageMonitor::SetStorageNotificationEnabled( |
| 654 const std::string& extension_id, | 654 const std::string& extension_id, |
| 655 bool enable_notifications) { | 655 bool enable_notifications) { |
| 656 extension_prefs_->UpdateExtensionPref( | 656 extension_prefs_->UpdateExtensionPref( |
| 657 extension_id, | 657 extension_id, |
| 658 kPrefDisableStorageNotifications, | 658 kPrefDisableStorageNotifications, |
| 659 enable_notifications ? NULL : new base::FundamentalValue(true)); | 659 enable_notifications ? NULL : new base::FundamentalValue(true)); |
| 660 } | 660 } |
| 661 | 661 |
| 662 } // namespace extensions | 662 } // namespace extensions |
| OLD | NEW |