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 #include "chrome/browser/extensions/extension_ui_util.h" | 5 #include "chrome/browser/extensions/extension_ui_util.h" |
6 | 6 |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/common/extensions/extension_constants.h" | 9 #include "chrome/common/extensions/extension_constants.h" |
10 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
11 #include "extensions/browser/extension_util.h" | 11 #include "extensions/browser/extension_util.h" |
| 12 #include "extensions/common/constants.h" |
12 #include "extensions/common/extension.h" | 13 #include "extensions/common/extension.h" |
13 | 14 |
14 namespace extensions { | 15 namespace extensions { |
15 | 16 |
16 namespace { | 17 namespace { |
17 | 18 |
18 bool IsBlockedByPolicy(const Extension* app, content::BrowserContext* context) { | 19 bool IsBlockedByPolicy(const Extension* app, content::BrowserContext* context) { |
19 Profile* profile = Profile::FromBrowserContext(context); | 20 Profile* profile = Profile::FromBrowserContext(context); |
20 DCHECK(profile); | 21 DCHECK(profile); |
21 | 22 |
22 return (app->id() == extension_misc::kWebStoreAppId || | 23 return (app->id() == extensions::kWebStoreAppId || |
23 app->id() == extension_misc::kEnterpriseWebStoreAppId) && | 24 app->id() == extension_misc::kEnterpriseWebStoreAppId) && |
24 profile->GetPrefs()->GetBoolean(prefs::kHideWebStoreIcon); | 25 profile->GetPrefs()->GetBoolean(prefs::kHideWebStoreIcon); |
25 } | 26 } |
26 | 27 |
27 } // namespace | 28 } // namespace |
28 | 29 |
29 namespace ui_util { | 30 namespace ui_util { |
30 | 31 |
31 bool ShouldDisplayInAppLauncher(const Extension* extension, | 32 bool ShouldDisplayInAppLauncher(const Extension* extension, |
32 content::BrowserContext* context) { | 33 content::BrowserContext* context) { |
(...skipping 21 matching lines...) Expand all Loading... |
54 } | 55 } |
55 | 56 |
56 bool ShouldNotBeVisible(const Extension* extension, | 57 bool ShouldNotBeVisible(const Extension* extension, |
57 content::BrowserContext* context) { | 58 content::BrowserContext* context) { |
58 return extension->ShouldNotBeVisible() || | 59 return extension->ShouldNotBeVisible() || |
59 util::IsEphemeralApp(extension->id(), context); | 60 util::IsEphemeralApp(extension->id(), context); |
60 } | 61 } |
61 | 62 |
62 } // namespace ui_util | 63 } // namespace ui_util |
63 } // namespace extensions | 64 } // namespace extensions |
OLD | NEW |