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

Side by Side Diff: chrome/browser/extensions/extension_ui_util.cc

Issue 1028503002: Don't show location bar in bookmark apps if there has been no navigation (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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/extension_ui_util.h" 5 #include "chrome/browser/extensions/extension_ui_util.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/common/extensions/extension_constants.h" 9 #include "chrome/common/extensions/extension_constants.h"
10 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" 10 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 bool ShouldShowLocationBar(const Extension* extension, 72 bool ShouldShowLocationBar(const Extension* extension,
73 const content::WebContents* web_contents) { 73 const content::WebContents* web_contents) {
74 // Default to not showing the location bar if either |extension| or 74 // Default to not showing the location bar if either |extension| or
75 // |web_contents| are null. |extension| is null for the dev tools. 75 // |web_contents| are null. |extension| is null for the dev tools.
76 if (!extension || !web_contents) 76 if (!extension || !web_contents)
77 return false; 77 return false;
78 78
79 if (!extension->from_bookmark()) 79 if (!extension->from_bookmark())
80 return false; 80 return false;
81 81
82 // Don't show a location bar until a navigation has occurred.
83 if (web_contents->GetLastCommittedURL().is_empty())
felt 2015/03/23 20:41:56 Can you test what happens here if you navigate to
benwells 2015/03/24 05:14:59 I've put a screenshot on the bug. Let me know if t
felt 2015/03/24 05:27:25 Thanks, yes, that's what I meant. I wanted to chec
84 return false;
85
82 GURL launch_url = AppLaunchInfo::GetLaunchWebURL(extension); 86 GURL launch_url = AppLaunchInfo::GetLaunchWebURL(extension);
83 return !(IsSameOriginOrMoreSecure(launch_url, 87 return !(IsSameOriginOrMoreSecure(launch_url,
84 web_contents->GetVisibleURL()) && 88 web_contents->GetVisibleURL()) &&
85 IsSameOriginOrMoreSecure(launch_url, 89 IsSameOriginOrMoreSecure(launch_url,
86 web_contents->GetLastCommittedURL())); 90 web_contents->GetLastCommittedURL()));
87 } 91 }
88 92
89 } // namespace ui_util 93 } // namespace ui_util
90 } // namespace extensions 94 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698