Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: chrome/browser/extensions/extension_storage_monitor.h

Issue 1497193002: Remove all the ephemeral apps code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Self review, Devlin review. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 CHROME_BROWSER_EXTENSIONS_EXTENSION_STORAGE_MONITOR_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_STORAGE_MONITOR_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_STORAGE_MONITOR_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_STORAGE_MONITOR_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 // ExtensionRegistryObserver overrides: 59 // ExtensionRegistryObserver overrides:
60 void OnExtensionLoaded(content::BrowserContext* browser_context, 60 void OnExtensionLoaded(content::BrowserContext* browser_context,
61 const Extension* extension) override; 61 const Extension* extension) override;
62 void OnExtensionUnloaded(content::BrowserContext* browser_context, 62 void OnExtensionUnloaded(content::BrowserContext* browser_context,
63 const Extension* extension, 63 const Extension* extension,
64 UnloadedExtensionInfo::Reason reason) override; 64 UnloadedExtensionInfo::Reason reason) override;
65 void OnExtensionWillBeInstalled(content::BrowserContext* browser_context, 65 void OnExtensionWillBeInstalled(content::BrowserContext* browser_context,
66 const Extension* extension, 66 const Extension* extension,
67 bool is_update, 67 bool is_update,
68 bool from_ephemeral,
69 const std::string& old_name) override; 68 const std::string& old_name) override;
70 void OnExtensionUninstalled(content::BrowserContext* browser_context, 69 void OnExtensionUninstalled(content::BrowserContext* browser_context,
71 const Extension* extension, 70 const Extension* extension,
72 extensions::UninstallReason reason) override; 71 extensions::UninstallReason reason) override;
73 72
74 // Overridden from ExtensionUninstallDialog::Delegate: 73 // Overridden from ExtensionUninstallDialog::Delegate:
75 void OnExtensionUninstallDialogClosed(bool did_start_uninstall, 74 void OnExtensionUninstallDialogClosed(bool did_start_uninstall,
76 const base::string16& error) override; 75 const base::string16& error) override;
77 76
78 std::string GetNotificationId(const std::string& extension_id); 77 std::string GetNotificationId(const std::string& extension_id);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 // consumes too much disk space. 110 // consumes too much disk space.
112 bool IsStorageNotificationEnabled(const std::string& extension_id) const; 111 bool IsStorageNotificationEnabled(const std::string& extension_id) const;
113 void SetStorageNotificationEnabled(const std::string& extension_id, 112 void SetStorageNotificationEnabled(const std::string& extension_id,
114 bool enable_notifications); 113 bool enable_notifications);
115 114
116 // Initially, monitoring will only be applied to ephemeral apps. This flag 115 // Initially, monitoring will only be applied to ephemeral apps. This flag
117 // is set by tests to enable for all extensions and apps. 116 // is set by tests to enable for all extensions and apps.
118 bool enable_for_all_extensions_; 117 bool enable_for_all_extensions_;
119 118
120 // The first notification is shown after the initial threshold is exceeded. 119 // The first notification is shown after the initial threshold is exceeded.
121 // Ephemeral apps have a lower threshold than fully installed extensions.
122 // A lower threshold is set by tests. 120 // A lower threshold is set by tests.
123 int64 initial_extension_threshold_; 121 int64 initial_extension_threshold_;
124 int64 initial_ephemeral_threshold_;
125 122
126 // The rate at which we would like to receive storage updates 123 // The rate at which we would like to receive storage updates
127 // from QuotaManager. Overridden in tests. 124 // from QuotaManager. Overridden in tests.
128 base::TimeDelta observer_rate_; 125 base::TimeDelta observer_rate_;
129 126
130 // IDs of extensions that notifications were shown for. 127 // IDs of extensions that notifications were shown for.
131 std::set<std::string> notified_extension_ids_; 128 std::set<std::string> notified_extension_ids_;
132 129
133 content::BrowserContext* context_; 130 content::BrowserContext* context_;
134 extensions::ExtensionPrefs* extension_prefs_; 131 extensions::ExtensionPrefs* extension_prefs_;
(...skipping 17 matching lines...) Expand all
152 149
153 friend class StorageEventObserver; 150 friend class StorageEventObserver;
154 friend class ExtensionStorageMonitorTest; 151 friend class ExtensionStorageMonitorTest;
155 152
156 DISALLOW_COPY_AND_ASSIGN(ExtensionStorageMonitor); 153 DISALLOW_COPY_AND_ASSIGN(ExtensionStorageMonitor);
157 }; 154 };
158 155
159 } // namespace extensions 156 } // namespace extensions
160 157
161 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_STORAGE_MONITOR_H_ 158 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_STORAGE_MONITOR_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service_unittest.cc ('k') | chrome/browser/extensions/extension_storage_monitor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698