Moved IS_EPHEMERAL flag to extension prefs
This patch moves the IS_EPHEMERAL flag from the Extension class to
extension prefs. This is because an Extension object is immutable and
this flag needs to be changed after creation to quickly promote a
running ephemeral app to being installed. Otherwise the install must
be delayed until the ephemeral app is closed.
BUG=374018
[email protected]
TEST=All automated tests
Review URL: https://codereview.chromium.org/282103003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272157 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/extensions/browser/extension_util.h b/extensions/browser/extension_util.h
new file mode 100644
index 0000000..8fd456e
--- /dev/null
+++ b/extensions/browser/extension_util.h
@@ -0,0 +1,32 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef EXTENSIONS_BROWSER_EXTENSION_UTIL_H_
+#define EXTENSIONS_BROWSER_EXTENSION_UTIL_H_
+
+#include <string>
+
+namespace content {
+class BrowserContext;
+}
+
+namespace extensions {
+namespace util {
+
+// TODO(tmdiep): Move functions from chrome/browser/extension_util.h/cc that are
+// only dependent on extensions/ here.
+
+// Returns true if |extension_id| identifies an extension that is installed
+// permanently and not ephemerally.
+bool IsExtensionInstalledPermanently(const std::string& extension_id,
+ content::BrowserContext* context);
+
+// Returns true if |extension_id| identifies an ephemeral app.
+bool IsEphemeralApp(const std::string& extension_id,
+ content::BrowserContext* context);
+
+} // namespace util
+} // namespace extensions
+
+#endif // EXTENSIONS_BROWSER_EXTENSION_UTIL_H_