| 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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 | 312 |
| 313 const Extension* extension = GetExtensionById(context_, | 313 const Extension* extension = GetExtensionById(context_, |
| 314 uninstall_extension_id_); | 314 uninstall_extension_id_); |
| 315 uninstall_extension_id_.clear(); | 315 uninstall_extension_id_.clear(); |
| 316 if (!extension) | 316 if (!extension) |
| 317 return; | 317 return; |
| 318 | 318 |
| 319 ExtensionService* service = | 319 ExtensionService* service = |
| 320 ExtensionSystem::Get(context_)->extension_service(); | 320 ExtensionSystem::Get(context_)->extension_service(); |
| 321 DCHECK(service); | 321 DCHECK(service); |
| 322 service->UninstallExtension( | 322 service->UninstallExtension(extension->id(), false, NULL); |
| 323 extension->id(), | |
| 324 ExtensionService::UNINSTALL_REASON_STORAGE_THRESHOLD_EXCEEDED, | |
| 325 NULL); | |
| 326 } | 323 } |
| 327 | 324 |
| 328 void ExtensionStorageMonitor::ExtensionUninstallCanceled() { | 325 void ExtensionStorageMonitor::ExtensionUninstallCanceled() { |
| 329 uninstall_extension_id_.clear(); | 326 uninstall_extension_id_.clear(); |
| 330 } | 327 } |
| 331 | 328 |
| 332 std::string ExtensionStorageMonitor::GetNotificationId( | 329 std::string ExtensionStorageMonitor::GetNotificationId( |
| 333 const std::string& extension_id) { | 330 const std::string& extension_id) { |
| 334 std::vector<std::string> placeholders; | 331 std::vector<std::string> placeholders; |
| 335 placeholders.push_back(context_->GetPath().BaseName().MaybeAsASCII()); | 332 placeholders.push_back(context_->GetPath().BaseName().MaybeAsASCII()); |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 void ExtensionStorageMonitor::SetStorageNotificationEnabled( | 606 void ExtensionStorageMonitor::SetStorageNotificationEnabled( |
| 610 const std::string& extension_id, | 607 const std::string& extension_id, |
| 611 bool enable_notifications) { | 608 bool enable_notifications) { |
| 612 extension_prefs_->UpdateExtensionPref( | 609 extension_prefs_->UpdateExtensionPref( |
| 613 extension_id, | 610 extension_id, |
| 614 kPrefDisableStorageNotifications, | 611 kPrefDisableStorageNotifications, |
| 615 enable_notifications ? NULL : new base::FundamentalValue(true)); | 612 enable_notifications ? NULL : new base::FundamentalValue(true)); |
| 616 } | 613 } |
| 617 | 614 |
| 618 } // namespace extensions | 615 } // namespace extensions |
| OLD | NEW |