Chromium Code Reviews| 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/extensions/manifest_handlers/app_launch_info.h" | |
| 10 #include "chrome/common/pref_names.h" | 11 #include "chrome/common/pref_names.h" |
| 12 #include "content/public/browser/web_contents.h" | |
| 11 #include "extensions/browser/extension_util.h" | 13 #include "extensions/browser/extension_util.h" |
| 12 #include "extensions/common/constants.h" | 14 #include "extensions/common/constants.h" |
| 13 #include "extensions/common/extension.h" | 15 #include "extensions/common/extension.h" |
| 14 | 16 |
| 15 namespace extensions { | 17 namespace extensions { |
| 16 | 18 |
| 17 namespace { | 19 namespace { |
| 18 | 20 |
| 19 bool IsBlockedByPolicy(const Extension* app, content::BrowserContext* context) { | 21 bool IsBlockedByPolicy(const Extension* app, content::BrowserContext* context) { |
| 20 Profile* profile = Profile::FromBrowserContext(context); | 22 Profile* profile = Profile::FromBrowserContext(context); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 return extension->ShouldDisplayInExtensionSettings() && | 55 return extension->ShouldDisplayInExtensionSettings() && |
| 54 !util::IsEphemeralApp(extension->id(), context); | 56 !util::IsEphemeralApp(extension->id(), context); |
| 55 } | 57 } |
| 56 | 58 |
| 57 bool ShouldNotBeVisible(const Extension* extension, | 59 bool ShouldNotBeVisible(const Extension* extension, |
| 58 content::BrowserContext* context) { | 60 content::BrowserContext* context) { |
| 59 return extension->ShouldNotBeVisible() || | 61 return extension->ShouldNotBeVisible() || |
| 60 util::IsEphemeralApp(extension->id(), context); | 62 util::IsEphemeralApp(extension->id(), context); |
| 61 } | 63 } |
| 62 | 64 |
| 65 bool ShouldShowLocationBar(const Extension* extension, | |
| 66 content::WebContents* web_contents) { | |
| 67 // Default to not showing the location bar. | |
| 68 if (!extension || !web_contents) | |
| 69 return false; | |
| 70 | |
| 71 GURL launch_url = AppLaunchInfo::GetLaunchWebURL(extension); | |
| 72 return extension->from_bookmark() && | |
| 73 web_contents->GetURL().GetOrigin() != launch_url.GetOrigin(); | |
|
Lei Zhang
2015/03/17 07:19:56
GetURL() has a big "DO NOT USE" comment.
benwells
2015/03/17 10:28:13
So it does... Replaced with visible URL as that is
| |
| 74 } | |
| 75 | |
| 63 } // namespace ui_util | 76 } // namespace ui_util |
| 64 } // namespace extensions | 77 } // namespace extensions |
| OLD | NEW |