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

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

Issue 305243002: Replace usage of GetActiveEntry with GetLastCommittedEntry in chrome/browser/ui. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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_command_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_commands.cc
diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc
index e2225bac044e306c1e8450572c8abddec57518b6..d86406fc13e2a97b5c7f4f7f573b70e99d65a79b 100644
--- a/chrome/browser/ui/browser_commands.cc
+++ b/chrome/browser/ui/browser_commands.cc
@@ -314,7 +314,7 @@ int GetContentRestrictions(const Browser* browser) {
CoreTabHelper::FromWebContents(current_tab);
content_restrictions = core_tab_helper->content_restrictions();
NavigationEntry* active_entry =
Peter Kasting 2014/06/02 18:38:58 Nit: Update this variable name
nasko 2014/06/02 20:44:23 Done.
- current_tab->GetController().GetActiveEntry();
+ current_tab->GetController().GetLastCommittedEntry();
// See comment in UpdateCommandsForTabState about why we call url().
Peter Kasting 2014/06/02 18:38:58 Nit: While here: "url()" no longer seems to exist,
nasko 2014/06/02 20:44:23 There is no such comment that I can see, so it see
if (!content::IsSavableURL(
active_entry ? active_entry->GetURL() : GURL()) ||
@@ -1080,7 +1080,7 @@ void DistillCurrentPage(Browser* browser) {
bool CanRequestTabletSite(WebContents* current_tab) {
if (!current_tab)
return false;
- return current_tab->GetController().GetActiveEntry() != NULL;
+ return current_tab->GetController().GetLastCommittedEntry() != NULL;
Peter Kasting 2014/06/02 18:38:58 Nit: Simpler: return current_tab && current_tab
nasko 2014/06/02 20:44:23 Done.
}
bool IsRequestingTabletSite(Browser* browser) {
@@ -1088,7 +1088,7 @@ bool IsRequestingTabletSite(Browser* browser) {
if (!current_tab)
return false;
content::NavigationEntry* entry =
- current_tab->GetController().GetActiveEntry();
+ current_tab->GetController().GetLastCommittedEntry();
if (!entry)
return false;
return entry->GetIsOverridingUserAgent();
@@ -1099,7 +1099,7 @@ void ToggleRequestTabletSite(Browser* browser) {
if (!current_tab)
return;
NavigationController& controller = current_tab->GetController();
- NavigationEntry* entry = controller.GetActiveEntry();
+ NavigationEntry* entry = controller.GetLastCommittedEntry();
if (!entry)
return;
if (entry->GetIsOverridingUserAgent()) {
@@ -1160,7 +1160,7 @@ void ViewSource(Browser* browser,
DCHECK(view_source_contents->GetController().CanPruneAllButLastCommitted());
view_source_contents->GetController().PruneAllButLastCommitted();
NavigationEntry* active_entry =
Peter Kasting 2014/06/02 18:38:58 Nit: Update this variable name.
nasko 2014/06/02 20:44:23 Done.
- view_source_contents->GetController().GetActiveEntry();
+ view_source_contents->GetController().GetLastCommittedEntry();
if (!active_entry)
return;
@@ -1250,7 +1250,7 @@ bool CanCreateBookmarkApp(const Browser* browser) {
void ConvertTabToAppWindow(Browser* browser,
content::WebContents* contents) {
- const GURL& url = contents->GetController().GetActiveEntry()->GetURL();
+ const GURL& url = contents->GetController().GetLastCommittedEntry()->GetURL();
std::string app_name = web_app::GenerateApplicationNameFromURL(url);
int index = browser->tab_strip_model()->GetIndexOfWebContents(contents);
« no previous file with comments | « chrome/browser/ui/browser_command_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698