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 #ifndef EXTENSIONS_BROWSER_EXTENSION_PREFS_H_ | 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_PREFS_H_ |
6 #define EXTENSIONS_BROWSER_EXTENSION_PREFS_H_ | 6 #define EXTENSIONS_BROWSER_EXTENSION_PREFS_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
| 12 #include "base/basictypes.h" |
12 #include "base/memory/linked_ptr.h" | 13 #include "base/memory/linked_ptr.h" |
13 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
14 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
15 #include "base/prefs/scoped_user_pref_update.h" | 16 #include "base/prefs/scoped_user_pref_update.h" |
16 #include "base/time/time.h" | 17 #include "base/time/time.h" |
17 #include "base/values.h" | 18 #include "base/values.h" |
18 #include "components/keyed_service/core/keyed_service.h" | 19 #include "components/keyed_service/core/keyed_service.h" |
19 #include "extensions/browser/app_sorting.h" | 20 #include "extensions/browser/app_sorting.h" |
20 #include "extensions/browser/blacklist_state.h" | 21 #include "extensions/browser/blacklist_state.h" |
21 #include "extensions/browser/extension_scoped_prefs.h" | 22 #include "extensions/browser/extension_scoped_prefs.h" |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 // Used for verification of installed extension ids. For the Set method, pass | 538 // Used for verification of installed extension ids. For the Set method, pass |
538 // null to remove the preference. | 539 // null to remove the preference. |
539 const base::DictionaryValue* GetInstallSignature(); | 540 const base::DictionaryValue* GetInstallSignature(); |
540 void SetInstallSignature(const base::DictionaryValue* signature); | 541 void SetInstallSignature(const base::DictionaryValue* signature); |
541 | 542 |
542 // The installation parameter associated with the extension. | 543 // The installation parameter associated with the extension. |
543 std::string GetInstallParam(const std::string& extension_id) const; | 544 std::string GetInstallParam(const std::string& extension_id) const; |
544 void SetInstallParam(const std::string& extension_id, | 545 void SetInstallParam(const std::string& extension_id, |
545 const std::string& install_parameter); | 546 const std::string& install_parameter); |
546 | 547 |
| 548 // Gets/sets the next threshold for displaying a notification if an extension |
| 549 // or app consumes excessive disk space. Returns 0 if the initial threshold |
| 550 // has not yet been reached. |
| 551 int64 GetNextStorageThreshold(const std::string& extension_id) const; |
| 552 void SetNextStorageThreshold(const std::string& extension_id, |
| 553 int64 next_threshold); |
| 554 |
| 555 // Gets/sets whether notifications should be shown if an extension or app |
| 556 // consumes too much disk space. |
| 557 bool IsStorageNotificationEnabled(const std::string& extension_id) const; |
| 558 void SetStorageNotificationEnabled(const std::string& extension_id, |
| 559 bool enable_notifications); |
| 560 |
547 private: | 561 private: |
548 friend class ExtensionPrefsBlacklistedExtensions; // Unit test. | 562 friend class ExtensionPrefsBlacklistedExtensions; // Unit test. |
549 friend class ExtensionPrefsUninstallExtension; // Unit test. | 563 friend class ExtensionPrefsUninstallExtension; // Unit test. |
550 | 564 |
551 enum DisableReasonChange { | 565 enum DisableReasonChange { |
552 DISABLE_REASON_ADD, | 566 DISABLE_REASON_ADD, |
553 DISABLE_REASON_REMOVE, | 567 DISABLE_REASON_REMOVE, |
554 DISABLE_REASON_CLEAR | 568 DISABLE_REASON_CLEAR |
555 }; | 569 }; |
556 | 570 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 bool extensions_disabled_; | 707 bool extensions_disabled_; |
694 | 708 |
695 ObserverList<ExtensionPrefsObserver> observer_list_; | 709 ObserverList<ExtensionPrefsObserver> observer_list_; |
696 | 710 |
697 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); | 711 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); |
698 }; | 712 }; |
699 | 713 |
700 } // namespace extensions | 714 } // namespace extensions |
701 | 715 |
702 #endif // EXTENSIONS_BROWSER_EXTENSION_PREFS_H_ | 716 #endif // EXTENSIONS_BROWSER_EXTENSION_PREFS_H_ |
OLD | NEW |