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

Unified Diff: chrome/browser/extensions/extension_ui_util.cc

Issue 1006273002: Show location for bookmark apps that have navigated across origin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/extension_ui_util.h ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..3ae3ca2ce669a474a3dbcbc889c286aca122e41f 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,
+ const content::WebContents* web_contents) {
+ // Default to not showing the location bar.
+ if (!extension || !web_contents)
+ return false;
felt 2015/03/17 14:52:54 Is it possible for either |extension| or |web_cont
benwells 2015/03/18 08:25:37 The extension is null when the window is for the d
+
+ GURL launch_url = AppLaunchInfo::GetLaunchWebURL(extension);
+ return extension->from_bookmark() &&
+ web_contents->GetVisibleURL().GetOrigin() != launch_url.GetOrigin();
felt 2015/03/17 14:52:54 I think you might want to return true if either Ge
benwells 2015/03/18 08:25:37 Done.
+}
+
} // namespace ui_util
} // namespace extensions
« no previous file with comments | « chrome/browser/extensions/extension_ui_util.h ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698