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

Unified Diff: chrome/browser/extensions/extension_prefs.cc

Issue 10875027: Restart running apps when chrome restarts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/extension_prefs.h ('k') | chrome/browser/extensions/platform_app_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_prefs.cc
diff --git a/chrome/browser/extensions/extension_prefs.cc b/chrome/browser/extensions/extension_prefs.cc
index 12389aca592eddd0222ef4840511a5a3cbeaffed..8cf771a91536532251bbc5cf15636970793b1757 100644
--- a/chrome/browser/extensions/extension_prefs.cc
+++ b/chrome/browser/extensions/extension_prefs.cc
@@ -40,6 +40,9 @@ namespace {
// Additional preferences keys
+// Whether this extension was running when chrome last shutdown.
+const char kPrefRunning[] = "running";
+
// Where an extension was installed from. (see Extension::Location)
const char kPrefLocation[] = "location";
@@ -1142,6 +1145,21 @@ void ExtensionPrefs::SetRegisteredEvents(
UpdateExtensionPref(extension_id, kRegisteredEvents, value);
}
+void ExtensionPrefs::SetExtensionRunning(const std::string& extension_id,
+ bool is_running) {
+ Value* value = Value::CreateBooleanValue(is_running);
+ UpdateExtensionPref(extension_id, kPrefRunning, value);
+}
+
+bool ExtensionPrefs::IsExtensionRunning(const std::string& extension_id) {
+ const DictionaryValue* extension = GetExtensionPref(extension_id);
+ if (!extension)
+ return false;
+ bool running = false;
+ extension->GetBoolean(kPrefRunning, &running);
+ return running;
+}
+
ExtensionOmniboxSuggestion
ExtensionPrefs::GetOmniboxDefaultSuggestion(const std::string& extension_id) {
ExtensionOmniboxSuggestion suggestion;
« no previous file with comments | « chrome/browser/extensions/extension_prefs.h ('k') | chrome/browser/extensions/platform_app_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698