OLD | NEW |
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 EXTENSIONS_BROWSER_EXTENSION_UTIL_H_ | 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_UTIL_H_ |
6 #define EXTENSIONS_BROWSER_EXTENSION_UTIL_H_ | 6 #define EXTENSIONS_BROWSER_EXTENSION_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
| 10 #include "extensions/common/features/feature_session_type.h" |
| 11 |
10 class GURL; | 12 class GURL; |
11 | 13 |
12 namespace content { | 14 namespace content { |
13 class BrowserContext; | 15 class BrowserContext; |
14 } | 16 } |
15 | 17 |
16 namespace extensions { | 18 namespace extensions { |
17 class Extension; | 19 class Extension; |
18 struct ExtensionInfo; | 20 struct ExtensionInfo; |
19 | 21 |
20 namespace util { | 22 namespace util { |
21 | 23 |
22 // TODO(benwells): Move functions from | 24 // TODO(benwells): Move functions from |
23 // chrome/browser/extensions/extension_util.h/cc that are only dependent on | 25 // chrome/browser/extensions/extension_util.h/cc that are only dependent on |
24 // extensions/ here. | 26 // extensions/ here. |
25 | 27 |
26 // Returns true if the extension has isolated storage. | 28 // Returns true if the extension has isolated storage. |
27 bool HasIsolatedStorage(const ExtensionInfo& info); | 29 bool HasIsolatedStorage(const ExtensionInfo& info); |
28 | 30 |
29 // Returns true if the site URL corresponds to an extension or app and has | 31 // Returns true if the site URL corresponds to an extension or app and has |
30 // isolated storage. | 32 // isolated storage. |
31 bool SiteHasIsolatedStorage(const GURL& extension_site_url, | 33 bool SiteHasIsolatedStorage(const GURL& extension_site_url, |
32 content::BrowserContext* context); | 34 content::BrowserContext* context); |
33 | 35 |
34 // Returns true if the extension can be enabled in incognito mode. | 36 // Returns true if the extension can be enabled in incognito mode. |
35 bool CanBeIncognitoEnabled(const Extension* extension); | 37 bool CanBeIncognitoEnabled(const Extension* extension); |
36 | 38 |
| 39 // Returns the session type based on the type of the user that is logged in. |
| 40 FeatureSessionType GetCurrentSessionType(); |
| 41 |
37 } // namespace util | 42 } // namespace util |
38 } // namespace extensions | 43 } // namespace extensions |
39 | 44 |
40 #endif // EXTENSIONS_BROWSER_EXTENSION_UTIL_H_ | 45 #endif // EXTENSIONS_BROWSER_EXTENSION_UTIL_H_ |
OLD | NEW |