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 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 notified_extension_ids_.clear(); | 540 notified_extension_ids_.clear(); |
541 } | 541 } |
542 | 542 |
543 void ExtensionStorageMonitor::ShowUninstallPrompt( | 543 void ExtensionStorageMonitor::ShowUninstallPrompt( |
544 const std::string& extension_id) { | 544 const std::string& extension_id) { |
545 const Extension* extension = GetExtensionById(context_, extension_id); | 545 const Extension* extension = GetExtensionById(context_, extension_id); |
546 if (!extension) | 546 if (!extension) |
547 return; | 547 return; |
548 | 548 |
549 if (!uninstall_dialog_.get()) { | 549 if (!uninstall_dialog_.get()) { |
550 uninstall_dialog_.reset(ExtensionUninstallDialog::Create( | 550 uninstall_dialog_.reset(ExtensionUninstallDialog::CreateAsStandaloneDialog( |
551 Profile::FromBrowserContext(context_), NULL, this)); | 551 Profile::FromBrowserContext(context_), this)); |
552 } | 552 } |
553 | 553 |
554 uninstall_extension_id_ = extension->id(); | 554 uninstall_extension_id_ = extension->id(); |
555 uninstall_dialog_->ConfirmUninstall(extension); | 555 uninstall_dialog_->ConfirmUninstall(extension); |
556 } | 556 } |
557 | 557 |
558 int64 ExtensionStorageMonitor::GetNextStorageThreshold( | 558 int64 ExtensionStorageMonitor::GetNextStorageThreshold( |
559 const std::string& extension_id) const { | 559 const std::string& extension_id) const { |
560 int next_threshold = GetNextStorageThresholdFromPrefs(extension_id); | 560 int next_threshold = GetNextStorageThresholdFromPrefs(extension_id); |
561 if (next_threshold == 0) { | 561 if (next_threshold == 0) { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 void ExtensionStorageMonitor::SetStorageNotificationEnabled( | 609 void ExtensionStorageMonitor::SetStorageNotificationEnabled( |
610 const std::string& extension_id, | 610 const std::string& extension_id, |
611 bool enable_notifications) { | 611 bool enable_notifications) { |
612 extension_prefs_->UpdateExtensionPref( | 612 extension_prefs_->UpdateExtensionPref( |
613 extension_id, | 613 extension_id, |
614 kPrefDisableStorageNotifications, | 614 kPrefDisableStorageNotifications, |
615 enable_notifications ? NULL : new base::FundamentalValue(true)); | 615 enable_notifications ? NULL : new base::FundamentalValue(true)); |
616 } | 616 } |
617 | 617 |
618 } // namespace extensions | 618 } // namespace extensions |
OLD | NEW |