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

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

Issue 22882007: Remove GetActiveEntry usage from chrome/browser/ui. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased on ToT. Created 7 years, 2 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
Index: chrome/browser/ui/browser_commands.cc
diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc
index c1e1a0963de00ed4ab94f38a340f7670c971df92..5b8b763962891aa6a4f9c4705d7d7dadafc20c70 100644
--- a/chrome/browser/ui/browser_commands.cc
+++ b/chrome/browser/ui/browser_commands.cc
@@ -253,7 +253,7 @@ int GetContentRestrictions(const Browser* browser) {
CoreTabHelper::FromWebContents(current_tab);
content_restrictions = core_tab_helper->content_restrictions();
NavigationEntry* active_entry =
- current_tab->GetController().GetActiveEntry();
+ current_tab->GetController().GetVisibleEntry();
// See comment in UpdateCommandsForTabState about why we call url().
if (!content::IsSavableURL(
active_entry ? active_entry->GetURL() : GURL()) ||
@@ -957,7 +957,7 @@ void ToggleSpeechInput(Browser* browser) {
bool CanRequestTabletSite(WebContents* current_tab) {
if (!current_tab)
return false;
- return current_tab->GetController().GetActiveEntry() != NULL;
+ return current_tab->GetController().GetVisibleEntry() != NULL;
}
bool IsRequestingTabletSite(Browser* browser) {
@@ -965,7 +965,7 @@ bool IsRequestingTabletSite(Browser* browser) {
if (!current_tab)
return false;
content::NavigationEntry* entry =
- current_tab->GetController().GetActiveEntry();
+ current_tab->GetController().GetVisibleEntry();
if (!entry)
return false;
return entry->GetIsOverridingUserAgent();
@@ -976,7 +976,7 @@ void ToggleRequestTabletSite(Browser* browser) {
if (!current_tab)
return;
NavigationController& controller = current_tab->GetController();
- NavigationEntry* entry = controller.GetActiveEntry();
+ NavigationEntry* entry = controller.GetVisibleEntry();
if (!entry)
return;
if (entry->GetIsOverridingUserAgent()) {
@@ -1037,7 +1037,7 @@ void ViewSource(Browser* browser,
DCHECK(view_source_contents->GetController().CanPruneAllButVisible());
view_source_contents->GetController().PruneAllButVisible();
NavigationEntry* active_entry =
- view_source_contents->GetController().GetActiveEntry();
+ view_source_contents->GetController().GetVisibleEntry();
if (!active_entry)
return;
@@ -1113,7 +1113,7 @@ bool CanCreateApplicationShortcuts(const Browser* browser) {
void ConvertTabToAppWindow(Browser* browser,
content::WebContents* contents) {
- const GURL& url = contents->GetController().GetActiveEntry()->GetURL();
+ const GURL& url = contents->GetController().GetVisibleEntry()->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') | chrome/browser/ui/cocoa/applescript/tab_applescript.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698