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

Unified Diff: chrome/browser/ui/browser.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: 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.cc ('k') | chrome/browser/ui/browser_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 338eccf4a02bccfa9c06c045671f2f3255209ea2..21e292e20d366e49ca21193170947b591c069953 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -55,6 +55,7 @@
#include "chrome/browser/extensions/api/tabs/tabs_windows_api.h"
#include "chrome/browser/extensions/browser_extension_window_controller.h"
#include "chrome/browser/extensions/extension_service.h"
+#include "chrome/browser/extensions/extension_ui_util.h"
#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/extensions/tab_helper.h"
#include "chrome/browser/favicon/favicon_tab_helper.h"
@@ -2413,19 +2414,33 @@ bool Browser::ShouldShowLocationBar() const {
if (is_type_tabbed())
return true;
- // Trusted app windows and system windows never show a location bar.
- return !is_app() && !is_trusted_source();
+ // Non-app windows that aren't tabbed or system windows should always show a
+ // location bar, unless they are from a trusted source.
+ if (!is_app())
+ return !is_trusted_source();
+
+ if (ShouldUseWebAppFrame())
+ return false;
+
+ // Bookmark apps should show the location bar.
+ const std::string extension_id =
+ web_app::GetExtensionIdFromApplicationName(app_name());
+ const extensions::Extension* extension =
+ extensions::ExtensionRegistry::Get(profile_)->GetExtensionById(
+ extension_id, extensions::ExtensionRegistry::EVERYTHING);
+ return extensions::ui_util::ShouldShowLocationBar(
+ extension, tab_strip_model_->GetActiveWebContents());
}
bool Browser::ShouldUseWebAppFrame() const {
- // Only use the web app frame for apps in ash, and only if bookmark apps are
- // enabled.
+ // Only use the web app frame for apps in ash, and only if the web app frame
+ // is enabled.
if (!is_app() || host_desktop_type() != chrome::HOST_DESKTOP_TYPE_ASH ||
!IsWebAppFrameEnabled()) {
return false;
}
- // Use the web app frame for hosted apps (which include bookmark apps).
+ // Use the web app frame for hosted apps.
const std::string extension_id =
web_app::GetExtensionIdFromApplicationName(app_name());
const extensions::Extension* extension =
« no previous file with comments | « chrome/browser/extensions/extension_ui_util.cc ('k') | chrome/browser/ui/browser_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698