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 | 8 |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 uninstall_extension_id_.clear(); | 317 uninstall_extension_id_.clear(); |
318 if (!extension) | 318 if (!extension) |
319 return; | 319 return; |
320 | 320 |
321 ExtensionService* service = | 321 ExtensionService* service = |
322 ExtensionSystem::Get(context_)->extension_service(); | 322 ExtensionSystem::Get(context_)->extension_service(); |
323 DCHECK(service); | 323 DCHECK(service); |
324 service->UninstallExtension( | 324 service->UninstallExtension( |
325 extension->id(), | 325 extension->id(), |
326 extensions::UNINSTALL_REASON_STORAGE_THRESHOLD_EXCEEDED, | 326 extensions::UNINSTALL_REASON_STORAGE_THRESHOLD_EXCEEDED, |
| 327 base::Bind(&base::DoNothing), |
327 NULL); | 328 NULL); |
328 } | 329 } |
329 | 330 |
330 void ExtensionStorageMonitor::ExtensionUninstallCanceled() { | 331 void ExtensionStorageMonitor::ExtensionUninstallCanceled() { |
331 uninstall_extension_id_.clear(); | 332 uninstall_extension_id_.clear(); |
332 } | 333 } |
333 | 334 |
334 std::string ExtensionStorageMonitor::GetNotificationId( | 335 std::string ExtensionStorageMonitor::GetNotificationId( |
335 const std::string& extension_id) { | 336 const std::string& extension_id) { |
336 std::vector<std::string> placeholders; | 337 std::vector<std::string> placeholders; |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 void ExtensionStorageMonitor::SetStorageNotificationEnabled( | 612 void ExtensionStorageMonitor::SetStorageNotificationEnabled( |
612 const std::string& extension_id, | 613 const std::string& extension_id, |
613 bool enable_notifications) { | 614 bool enable_notifications) { |
614 extension_prefs_->UpdateExtensionPref( | 615 extension_prefs_->UpdateExtensionPref( |
615 extension_id, | 616 extension_id, |
616 kPrefDisableStorageNotifications, | 617 kPrefDisableStorageNotifications, |
617 enable_notifications ? NULL : new base::FundamentalValue(true)); | 618 enable_notifications ? NULL : new base::FundamentalValue(true)); |
618 } | 619 } |
619 | 620 |
620 } // namespace extensions | 621 } // namespace extensions |
OLD | NEW |