Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(611)

Side by Side Diff: chrome/browser/extensions/extension_ui_util.cc

Issue 311293002: Ensure ephemeral apps have dock icons on mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use new enum instead of hidden Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 CanDisplayInAppLauncher(extension, context) &&
34 !util::IsEphemeralApp(extension->id(), context);
35 }
36
37 bool CanDisplayInAppLauncher(const Extension* extension,
38 content::BrowserContext* context) {
33 return extension->ShouldDisplayInAppLauncher() && 39 return extension->ShouldDisplayInAppLauncher() &&
34 !IsBlockedByPolicy(extension, context) && 40 !IsBlockedByPolicy(extension, context);
35 !util::IsEphemeralApp(extension->id(), context);
36 } 41 }
37 42
38 bool ShouldDisplayInNewTabPage(const Extension* extension, 43 bool ShouldDisplayInNewTabPage(const Extension* extension,
39 content::BrowserContext* context) { 44 content::BrowserContext* context) {
40 return extension->ShouldDisplayInNewTabPage() && 45 return extension->ShouldDisplayInNewTabPage() &&
41 !IsBlockedByPolicy(extension, context) && 46 !IsBlockedByPolicy(extension, context) &&
42 !util::IsEphemeralApp(extension->id(), context); 47 !util::IsEphemeralApp(extension->id(), context);
43 } 48 }
44 49
45 bool ShouldDisplayInExtensionSettings(const Extension* extension, 50 bool ShouldDisplayInExtensionSettings(const Extension* extension,
46 content::BrowserContext* context) { 51 content::BrowserContext* context) {
47 return extension->ShouldDisplayInExtensionSettings() && 52 return extension->ShouldDisplayInExtensionSettings() &&
48 !util::IsEphemeralApp(extension->id(), context); 53 !util::IsEphemeralApp(extension->id(), context);
49 } 54 }
50 55
51 bool ShouldNotBeVisible(const Extension* extension, 56 bool ShouldNotBeVisible(const Extension* extension,
52 content::BrowserContext* context) { 57 content::BrowserContext* context) {
53 return extension->ShouldNotBeVisible() || 58 return extension->ShouldNotBeVisible() ||
54 util::IsEphemeralApp(extension->id(), context); 59 util::IsEphemeralApp(extension->id(), context);
55 } 60 }
56 61
57 } // namespace ui_util 62 } // namespace ui_util
58 } // namespace extensions 63 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_ui_util.h ('k') | chrome/browser/web_applications/web_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698