summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_ui_util.cc
diff options
context:
space:
mode:
authorbenwells <benwells@chromium.org>2015-04-07 00:09:54 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-07 07:10:25 +0000
commita2a8a9f7da0b4f37de73d41fe562c55fcc518f9e (patch)
tree09787e0bf22d208ab70adf25d47055c3bfd85eda /chrome/browser/extensions/extension_ui_util.cc
parentf49fd3bdf61ee09d8b9985b462837f4f2e1f087e (diff)
downloadchromium_src-a2a8a9f7da0b4f37de73d41fe562c55fcc518f9e.zip
chromium_src-a2a8a9f7da0b4f37de73d41fe562c55fcc518f9e.tar.gz
chromium_src-a2a8a9f7da0b4f37de73d41fe562c55fcc518f9e.tar.bz2
Animate showing / hiding the location bar for bookmark apps.
Bookmark apps no longer toggle whether they support the location bar via the browser features system, which didn't seem correct. Instead they support the location bar feature always but change how the location bar's height to bring it into and out of view. This change also introduces a BookmarkAppBrowserController class to encapsulate all the logic for bookmark apps to modify the browser UI. BUG=463405 Review URL: https://codereview.chromium.org/1036173002 Cr-Commit-Position: refs/heads/master@{#324020}
Diffstat (limited to 'chrome/browser/extensions/extension_ui_util.cc')
-rw-r--r--chrome/browser/extensions/extension_ui_util.cc30
1 files changed, 0 insertions, 30 deletions
diff --git a/chrome/browser/extensions/extension_ui_util.cc b/chrome/browser/extensions/extension_ui_util.cc
index 818b4ac..4cf4fa8 100644
--- a/chrome/browser/extensions/extension_ui_util.cc
+++ b/chrome/browser/extensions/extension_ui_util.cc
@@ -7,9 +7,7 @@
#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"
@@ -27,13 +25,6 @@ bool IsBlockedByPolicy(const Extension* app, content::BrowserContext* context) {
profile->GetPrefs()->GetBoolean(prefs::kHideWebStoreIcon);
}
-bool IsSameOriginOrMoreSecure(const GURL& app_url, const GURL& page_url) {
- return (app_url.scheme() == page_url.scheme() ||
- page_url.scheme() == url::kHttpsScheme) &&
- app_url.host() == page_url.host() &&
- app_url.port() == page_url.port();
-}
-
} // namespace
namespace ui_util {
@@ -69,26 +60,5 @@ 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 either |extension| or
- // |web_contents| are null. |extension| is null for the dev tools.
- if (!extension || !web_contents)
- return false;
-
- if (!extension->from_bookmark())
- return false;
-
- // Don't show a location bar until a navigation has occurred.
- if (web_contents->GetLastCommittedURL().is_empty())
- return false;
-
- GURL launch_url = AppLaunchInfo::GetLaunchWebURL(extension);
- return !(IsSameOriginOrMoreSecure(launch_url,
- web_contents->GetVisibleURL()) &&
- IsSameOriginOrMoreSecure(launch_url,
- web_contents->GetLastCommittedURL()));
-}
-
} // namespace ui_util
} // namespace extensions