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