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" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 #include "chrome/browser/chrome_notification_types.h" | 12 #include "chrome/browser/chrome_notification_types.h" |
13 #include "chrome/browser/extensions/extension_service.h" | 13 #include "chrome/browser/extensions/extension_service.h" |
14 #include "chrome/browser/extensions/extension_storage_monitor_factory.h" | 14 #include "chrome/browser/extensions/extension_storage_monitor_factory.h" |
15 #include "chrome/browser/extensions/extension_util.h" | 15 #include "chrome/browser/extensions/extension_util.h" |
16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
17 #include "chrome/browser/ui/app_list/app_list_service.h" | |
18 #include "chrome/browser/ui/host_desktop.h" | |
tmdiep
2014/07/11 06:13:29
Looks like you don't need these includes anymore.
sashab
2014/07/13 22:57:25
Done.
| |
17 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" | 19 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" |
18 #include "content/public/browser/browser_context.h" | 20 #include "content/public/browser/browser_context.h" |
19 #include "content/public/browser/browser_thread.h" | 21 #include "content/public/browser/browser_thread.h" |
20 #include "content/public/browser/notification_details.h" | 22 #include "content/public/browser/notification_details.h" |
21 #include "content/public/browser/notification_source.h" | 23 #include "content/public/browser/notification_source.h" |
22 #include "content/public/browser/storage_partition.h" | 24 #include "content/public/browser/storage_partition.h" |
23 #include "extensions/browser/extension_prefs.h" | 25 #include "extensions/browser/extension_prefs.h" |
24 #include "extensions/browser/extension_registry.h" | 26 #include "extensions/browser/extension_registry.h" |
25 #include "extensions/browser/extension_system.h" | 27 #include "extensions/browser/extension_system.h" |
26 #include "extensions/browser/image_loader.h" | 28 #include "extensions/browser/image_loader.h" |
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
540 notified_extension_ids_.clear(); | 542 notified_extension_ids_.clear(); |
541 } | 543 } |
542 | 544 |
543 void ExtensionStorageMonitor::ShowUninstallPrompt( | 545 void ExtensionStorageMonitor::ShowUninstallPrompt( |
544 const std::string& extension_id) { | 546 const std::string& extension_id) { |
545 const Extension* extension = GetExtensionById(context_, extension_id); | 547 const Extension* extension = GetExtensionById(context_, extension_id); |
546 if (!extension) | 548 if (!extension) |
547 return; | 549 return; |
548 | 550 |
549 if (!uninstall_dialog_.get()) { | 551 if (!uninstall_dialog_.get()) { |
550 uninstall_dialog_.reset(ExtensionUninstallDialog::Create( | 552 uninstall_dialog_.reset(ExtensionUninstallDialog::CreateAsStandaloneDialog( |
551 Profile::FromBrowserContext(context_), NULL, this)); | 553 Profile::FromBrowserContext(context_), this)); |
552 } | 554 } |
553 | 555 |
554 uninstall_extension_id_ = extension->id(); | 556 uninstall_extension_id_ = extension->id(); |
555 uninstall_dialog_->ConfirmUninstall(extension); | 557 uninstall_dialog_->ConfirmUninstall(extension); |
556 } | 558 } |
557 | 559 |
558 int64 ExtensionStorageMonitor::GetNextStorageThreshold( | 560 int64 ExtensionStorageMonitor::GetNextStorageThreshold( |
559 const std::string& extension_id) const { | 561 const std::string& extension_id) const { |
560 int next_threshold = GetNextStorageThresholdFromPrefs(extension_id); | 562 int next_threshold = GetNextStorageThresholdFromPrefs(extension_id); |
561 if (next_threshold == 0) { | 563 if (next_threshold == 0) { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
609 void ExtensionStorageMonitor::SetStorageNotificationEnabled( | 611 void ExtensionStorageMonitor::SetStorageNotificationEnabled( |
610 const std::string& extension_id, | 612 const std::string& extension_id, |
611 bool enable_notifications) { | 613 bool enable_notifications) { |
612 extension_prefs_->UpdateExtensionPref( | 614 extension_prefs_->UpdateExtensionPref( |
613 extension_id, | 615 extension_id, |
614 kPrefDisableStorageNotifications, | 616 kPrefDisableStorageNotifications, |
615 enable_notifications ? NULL : new base::FundamentalValue(true)); | 617 enable_notifications ? NULL : new base::FundamentalValue(true)); |
616 } | 618 } |
617 | 619 |
618 } // namespace extensions | 620 } // namespace extensions |
OLD | NEW |