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

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

Issue 11419307: Garbage Collect the Storage directory on next profile start after an extension uninstall. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: done done Created 8 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/extensions/data_deleter.cc ('k') | chrome/browser/extensions/extension_prefs.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_PREFS_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 // Caller takes ownership of returned structure. 377 // Caller takes ownership of returned structure.
378 scoped_ptr<ExtensionsInfo> GetInstalledExtensionsInfo() const; 378 scoped_ptr<ExtensionsInfo> GetInstalledExtensionsInfo() const;
379 379
380 // Returns the ExtensionInfo from the prefs for the given extension. If the 380 // Returns the ExtensionInfo from the prefs for the given extension. If the
381 // extension is not present, NULL is returned. 381 // extension is not present, NULL is returned.
382 scoped_ptr<ExtensionInfo> GetInstalledExtensionInfo( 382 scoped_ptr<ExtensionInfo> GetInstalledExtensionInfo(
383 const std::string& extension_id) const; 383 const std::string& extension_id) const;
384 384
385 // We've downloaded an updated .crx file for the extension, but are waiting 385 // We've downloaded an updated .crx file for the extension, but are waiting
386 // for idle time to install it. 386 // for idle time to install it.
387 void SetIdleInstallInfo(const Extension* extension, 387 void SetDelayedInstallInfo(const Extension* extension,
388 Extension::State initial_state, 388 Extension::State initial_state,
389 const syncer::StringOrdinal& page_ordinal); 389 const syncer::StringOrdinal& page_ordinal);
390 390
391 // Removes any idle install information we have for the given |extension_id|. 391 // Removes any delayed install information we have for the given
392 // Returns true if there was info to remove; false otherwise. 392 // |extension_id|. Returns true if there was info to remove; false otherwise.
393 bool RemoveIdleInstallInfo(const std::string& extension_id); 393 bool RemoveDelayedInstallInfo(const std::string& extension_id);
394 394
395 // Update the prefs to finish the update for an extension. 395 // Update the prefs to finish the update for an extension.
396 bool FinishIdleInstallInfo(const std::string& extension_id); 396 bool FinishDelayedInstallInfo(const std::string& extension_id);
397 397
398 // Returns the ExtensionInfo from the prefs for idle install information for 398 // Returns the ExtensionInfo from the prefs for delayed install information
399 // |extension_id|, if we have any. Otherwise returns NULL. 399 // for |extension_id|, if we have any. Otherwise returns NULL.
400 scoped_ptr<ExtensionInfo> GetIdleInstallInfo( 400 scoped_ptr<ExtensionInfo> GetDelayedInstallInfo(
401 const std::string& extension_id) const; 401 const std::string& extension_id) const;
402 402
403 // Returns information about all the extensions that have pending idle 403 // Returns information about all the extensions that have delayed install
404 // install information. 404 // information.
405 scoped_ptr<ExtensionsInfo> GetAllIdleInstallInfo() const; 405 scoped_ptr<ExtensionsInfo> GetAllDelayedInstallInfo() const;
406 406
407 // We allow the web store to set a string containing login information when a 407 // We allow the web store to set a string containing login information when a
408 // purchase is made, so that when a user logs into sync with a different 408 // purchase is made, so that when a user logs into sync with a different
409 // account we can recognize the situation. The Get function returns true if 409 // account we can recognize the situation. The Get function returns true if
410 // there was previously stored data (placing it in |result|), or false 410 // there was previously stored data (placing it in |result|), or false
411 // otherwise. The Set will overwrite any previous login. 411 // otherwise. The Set will overwrite any previous login.
412 bool GetWebStoreLogin(std::string* result); 412 bool GetWebStoreLogin(std::string* result);
413 void SetWebStoreLogin(const std::string& login); 413 void SetWebStoreLogin(const std::string& login);
414 414
415 // Returns true if the one-time Sideload Wipeout effort has been executed. 415 // Returns true if the one-time Sideload Wipeout effort has been executed.
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 496
497 // The underlying ExtensionSorting. 497 // The underlying ExtensionSorting.
498 ExtensionSorting* extension_sorting() const { 498 ExtensionSorting* extension_sorting() const {
499 return extension_sorting_.get(); 499 return extension_sorting_.get();
500 } 500 }
501 501
502 // Describes the URLs that are able to install extensions. See 502 // Describes the URLs that are able to install extensions. See
503 // prefs::kExtensionAllowedInstallSites for more information. 503 // prefs::kExtensionAllowedInstallSites for more information.
504 URLPatternSet GetAllowedInstallSites(); 504 URLPatternSet GetAllowedInstallSites();
505 505
506 // Schedules garbage collection of an extension's on-disk data on the next
507 // start of this ExtensionService. Applies only to extensions with isolated
508 // storage.
509 void SetNeedsStorageGarbageCollection(bool value);
510 bool NeedsStorageGarbageCollection();
511
506 private: 512 private:
507 friend class ExtensionPrefsBlacklistedExtensions; // Unit test. 513 friend class ExtensionPrefsBlacklistedExtensions; // Unit test.
508 friend class ExtensionPrefsUninstallExtension; // Unit test. 514 friend class ExtensionPrefsUninstallExtension; // Unit test.
509 515
510 // See the Create methods. 516 // See the Create methods.
511 ExtensionPrefs(PrefService* prefs, 517 ExtensionPrefs(PrefService* prefs,
512 const FilePath& root_dir, 518 const FilePath& root_dir,
513 ExtensionPrefValueMap* extension_pref_value_map, 519 ExtensionPrefValueMap* extension_pref_value_map,
514 scoped_ptr<TimeProvider> time_provider); 520 scoped_ptr<TimeProvider> time_provider);
515 521
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 scoped_refptr<ContentSettingsStore> content_settings_store_; 649 scoped_refptr<ContentSettingsStore> content_settings_store_;
644 650
645 scoped_ptr<TimeProvider> time_provider_; 651 scoped_ptr<TimeProvider> time_provider_;
646 652
647 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs); 653 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefs);
648 }; 654 };
649 655
650 } // namespace extensions 656 } // namespace extensions
651 657
652 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_ 658 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/data_deleter.cc ('k') | chrome/browser/extensions/extension_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698