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