Chromium Code Reviews| Index: chrome/browser/extensions/extension_ui_util.cc |
| diff --git a/chrome/browser/extensions/extension_ui_util.cc b/chrome/browser/extensions/extension_ui_util.cc |
| index 4cf4fa89775566d31d8bf15def03738d868f8219..7dc5cb4b506c2a95c0038b77d9731f22d6bf938f 100644 |
| --- a/chrome/browser/extensions/extension_ui_util.cc |
| +++ b/chrome/browser/extensions/extension_ui_util.cc |
| @@ -7,7 +7,9 @@ |
| #include "base/prefs/pref_service.h" |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/common/extensions/extension_constants.h" |
| +#include "chrome/common/extensions/manifest_handlers/app_launch_info.h" |
| #include "chrome/common/pref_names.h" |
| +#include "content/public/browser/web_contents.h" |
| #include "extensions/browser/extension_util.h" |
| #include "extensions/common/constants.h" |
| #include "extensions/common/extension.h" |
| @@ -60,5 +62,16 @@ bool ShouldNotBeVisible(const Extension* extension, |
| util::IsEphemeralApp(extension->id(), context); |
| } |
| +bool ShouldShowLocationBar(const Extension* extension, |
| + content::WebContents* web_contents) { |
| + // Default to not showing the location bar. |
| + if (!extension || !web_contents) |
| + return false; |
| + |
| + GURL launch_url = AppLaunchInfo::GetLaunchWebURL(extension); |
| + return extension->from_bookmark() && |
| + 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
|
| +} |
| + |
| } // namespace ui_util |
| } // namespace extensions |