| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_GARBAGE_COLLECTOR_CHROMEOS_H_ | |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_GARBAGE_COLLECTOR_CHROMEOS_H_ | |
| 7 | |
| 8 #include "chrome/browser/extensions/extension_garbage_collector.h" | |
| 9 | |
| 10 namespace extensions { | |
| 11 | |
| 12 // Chrome OS specific extensions garbage collector. In addition to base class | |
| 13 // it also cleans up extensions install directory in shared location, see | |
| 14 // ExtensionAssetsManagerChromeOS. | |
| 15 class ExtensionGarbageCollectorChromeOS : public ExtensionGarbageCollector { | |
| 16 public: | |
| 17 explicit ExtensionGarbageCollectorChromeOS(content::BrowserContext* context); | |
| 18 virtual ~ExtensionGarbageCollectorChromeOS(); | |
| 19 | |
| 20 static ExtensionGarbageCollectorChromeOS* Get( | |
| 21 content::BrowserContext* context); | |
| 22 | |
| 23 // Enable or disable garbage collection. See |disable_garbage_collection_|. | |
| 24 void disable_garbage_collection() { disable_garbage_collection_ = true; } | |
| 25 void enable_garbage_collection() { disable_garbage_collection_ = false; } | |
| 26 | |
| 27 private: | |
| 28 // Overriddes for ExtensionGarbageCollector: | |
| 29 virtual void GarbageCollectExtensions() OVERRIDE; | |
| 30 | |
| 31 // Return true if there is no extension installation for all active profiles. | |
| 32 bool CanGarbageCollectSharedExtensions(); | |
| 33 | |
| 34 // Do GC for shared extensions dir. | |
| 35 void GarbageCollectSharedExtensions(); | |
| 36 | |
| 37 // TODO(rkc): HACK alert - this is only in place to allow the | |
| 38 // kiosk_mode_screensaver to prevent its extension from getting garbage | |
| 39 // collected. Remove this once KioskModeScreensaver is removed. | |
| 40 // See crbug.com/280363 | |
| 41 bool disable_garbage_collection_; | |
| 42 | |
| 43 // Shared extensions need to be processed only once but instances of this | |
| 44 // class are created per-profile so this static variable prevents multiple | |
| 45 // processing. | |
| 46 static bool shared_extensions_garbage_collected; | |
| 47 | |
| 48 DISALLOW_COPY_AND_ASSIGN(ExtensionGarbageCollectorChromeOS); | |
| 49 }; | |
| 50 | |
| 51 } // namespace extensions | |
| 52 | |
| 53 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_GARBAGE_COLLECTOR_CHROMEOS_H_ | |
| OLD | NEW |