| 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" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 app->id() == extension_misc::kEnterpriseWebStoreAppId) && | 24 app->id() == extension_misc::kEnterpriseWebStoreAppId) && |
| 25 profile->GetPrefs()->GetBoolean(prefs::kHideWebStoreIcon); | 25 profile->GetPrefs()->GetBoolean(prefs::kHideWebStoreIcon); |
| 26 } | 26 } |
| 27 | 27 |
| 28 } // namespace | 28 } // namespace |
| 29 | 29 |
| 30 namespace ui_util { | 30 namespace ui_util { |
| 31 | 31 |
| 32 bool ShouldDisplayInAppLauncher(const Extension* extension, | 32 bool ShouldDisplayInAppLauncher(const Extension* extension, |
| 33 content::BrowserContext* context) { | 33 content::BrowserContext* context) { |
| 34 return CanDisplayInAppLauncher(extension, context) && | 34 return CanDisplayInAppLauncher(extension, context); |
| 35 !util::IsEphemeralApp(extension->id(), context); | |
| 36 } | 35 } |
| 37 | 36 |
| 38 bool CanDisplayInAppLauncher(const Extension* extension, | 37 bool CanDisplayInAppLauncher(const Extension* extension, |
| 39 content::BrowserContext* context) { | 38 content::BrowserContext* context) { |
| 40 return extension->ShouldDisplayInAppLauncher() && | 39 return extension->ShouldDisplayInAppLauncher() && |
| 41 !IsBlockedByPolicy(extension, context); | 40 !IsBlockedByPolicy(extension, context); |
| 42 } | 41 } |
| 43 | 42 |
| 44 bool ShouldDisplayInNewTabPage(const Extension* extension, | 43 bool ShouldDisplayInNewTabPage(const Extension* extension, |
| 45 content::BrowserContext* context) { | 44 content::BrowserContext* context) { |
| 46 return extension->ShouldDisplayInNewTabPage() && | 45 return extension->ShouldDisplayInNewTabPage() && |
| 47 !IsBlockedByPolicy(extension, context) && | 46 !IsBlockedByPolicy(extension, context); |
| 48 !util::IsEphemeralApp(extension->id(), context); | |
| 49 } | 47 } |
| 50 | 48 |
| 51 bool ShouldDisplayInExtensionSettings(const Extension* extension, | 49 bool ShouldDisplayInExtensionSettings(const Extension* extension, |
| 52 content::BrowserContext* context) { | 50 content::BrowserContext* context) { |
| 53 return extension->ShouldDisplayInExtensionSettings() && | 51 return extension->ShouldDisplayInExtensionSettings(); |
| 54 !util::IsEphemeralApp(extension->id(), context); | |
| 55 } | 52 } |
| 56 | 53 |
| 57 bool ShouldNotBeVisible(const Extension* extension, | 54 bool ShouldNotBeVisible(const Extension* extension, |
| 58 content::BrowserContext* context) { | 55 content::BrowserContext* context) { |
| 59 return extension->ShouldNotBeVisible() || | 56 return extension->ShouldNotBeVisible(); |
| 60 util::IsEphemeralApp(extension->id(), context); | |
| 61 } | 57 } |
| 62 | 58 |
| 63 } // namespace ui_util | 59 } // namespace ui_util |
| 64 } // namespace extensions | 60 } // namespace extensions |
| OLD | NEW |