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

Unified Diff: chrome/browser/ui/browser.cc

Issue 178863002: Implement settings in a widnow (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 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/ui/browser.h ('k') | chrome/browser/ui/chrome_pages.h » ('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 f294cecbf7ae30574d2f1585d6d522aa5f66148f..cfe4cd1d05713ec95eaffafbebc129f6c9b90f01 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -2179,6 +2179,35 @@ void Browser::TabDetachedAtImpl(content::WebContents* contents,
}
}
+bool Browser::ShouldShowLocationBar() const {
+ if (!is_app()) {
+ // Hide the URL for singleton settings windows.
+ // TODO(stevenjb): We could avoid this check by setting a Browser
+ // property for "system" windows, possibly shared with hosted app windows.
+ // crbug.com/350128.
+ if (chrome::IsSettingsWindow(this))
+ return false;
+ return true;
+ }
+
+ // Normally apps do not show a location bar.
+ if (app_type() != APP_TYPE_HOST ||
+ app_name() == DevToolsWindow::kDevToolsApp ||
+ !CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableStreamlinedHostedApps))
+ return false;
+
+ // If kEnableStreamlinedHostedApps is true, show the locaiton bar for non
+ // legacy packaged apps.
+ ExtensionService* service =
+ extensions::ExtensionSystem::Get(profile_)->extension_service();
+ const extensions::Extension* extension =
+ service ? service->GetInstalledExtension(
+ web_app::GetExtensionIdFromApplicationName(app_name()))
+ : NULL;
+ return (!extension || !extension->is_legacy_packaged_app());
+}
+
bool Browser::SupportsWindowFeatureImpl(WindowFeature feature,
bool check_fullscreen) const {
bool hide_ui_for_fullscreen = check_fullscreen && ShouldHideUIForFullscreen();
@@ -2198,20 +2227,8 @@ bool Browser::SupportsWindowFeatureImpl(WindowFeature feature,
if (is_type_tabbed())
features |= FEATURE_TOOLBAR;
- ExtensionService* service =
- extensions::ExtensionSystem::Get(profile_)->extension_service();
- const extensions::Extension* extension =
- service ? service->GetInstalledExtension(
- web_app::GetExtensionIdFromApplicationName(app_name()))
- : NULL;
-
- if (!is_app() || (app_type() == APP_TYPE_HOST &&
- app_name() != DevToolsWindow::kDevToolsApp &&
- (!extension || !extension->is_legacy_packaged_app()) &&
- CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableStreamlinedHostedApps))) {
+ if (ShouldShowLocationBar())
features |= FEATURE_LOCATIONBAR;
- }
}
return !!(features & feature);
}
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/chrome_pages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698