diff options
author | laforge@chromium.org <laforge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-14 16:30:24 +0000 |
---|---|---|
committer | laforge@chromium.org <laforge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-14 16:30:24 +0000 |
commit | ff84949e05715b4ef84a6a69b41227aafb5d6c7e (patch) | |
tree | 98e7b6cf48fa0c633d339d58da50bb32a874f5da | |
parent | 08b0d5960022e503ae53a10e9cebb72f8d13a384 (diff) | |
download | chromium_src-ff84949e05715b4ef84a6a69b41227aafb5d6c7e.zip chromium_src-ff84949e05715b4ef84a6a69b41227aafb5d6c7e.tar.gz chromium_src-ff84949e05715b4ef84a6a69b41227aafb5d6c7e.tar.bz2 |
Merge 241125 "Revert of https://codereview.chromium.org/68713009/"
> Revert of https://codereview.chromium.org/68713009/
> Reason for revert: Led to a URL bar display error, issue 324208.
>
> TBR=benwells@chromium.org,creis@chromium.org,sky@chromium.org
> NOTREECHECKS=true
> NOTRY=true
>
> BUG=324208
>
> Review URL: https://codereview.chromium.org/99853005
TBR=jww@chromium.org
Review URL: https://codereview.chromium.org/167093002
git-svn-id: svn://svn.chromium.org/chrome/branches/1750/src@251346 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/ui/browser.cc | 2 | ||||
-rw-r--r-- | chrome/browser/ui/browser_browsertest.cc | 4 | ||||
-rw-r--r-- | chrome/browser/ui/browser_command_controller.cc | 2 | ||||
-rw-r--r-- | chrome/browser/ui/browser_commands.cc | 31 |
4 files changed, 20 insertions, 19 deletions
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index c71167b..21f9afe 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -1416,7 +1416,7 @@ void Browser::BeforeUnloadFired(WebContents* web_contents, bool Browser::ShouldFocusLocationBarByDefault(WebContents* source) { const content::NavigationEntry* entry = - source->GetController().GetVisibleEntry(); + source->GetController().GetActiveEntry(); if (entry) { GURL url = entry->GetURL(); GURL virtual_url = entry->GetVirtualURL(); diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc index 16261a8..acaa74b 100644 --- a/chrome/browser/ui/browser_browsertest.cc +++ b/chrome/browser/ui/browser_browsertest.cc @@ -1139,7 +1139,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, ui_test_utils::NavigateToURL(browser(), url); NavigationEntry* entry = browser()->tab_strip_model()-> - GetActiveWebContents()->GetController().GetVisibleEntry(); + GetActiveWebContents()->GetController().GetActiveEntry(); EXPECT_EQ(expected_favicon_url.spec(), entry->GetFavicon().url.spec()); } @@ -1159,7 +1159,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_FaviconChange) { ui_test_utils::NavigateToURL(browser(), file_url); NavigationEntry* entry = browser()->tab_strip_model()-> - GetActiveWebContents()->GetController().GetVisibleEntry(); + GetActiveWebContents()->GetController().GetActiveEntry(); static const base::FilePath::CharType* kIcon = FILE_PATH_LITERAL("test1.png"); GURL expected_favicon_url(ui_test_utils::GetTestUrl(base::FilePath( diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc index 6fdff5f..3c32f82 100644 --- a/chrome/browser/ui/browser_command_controller.cc +++ b/chrome/browser/ui/browser_command_controller.cc @@ -1095,7 +1095,7 @@ void BrowserCommandController::UpdateCommandsForTabState() { // Changing the encoding is not possible on Chrome-internal webpages. NavigationController& nc = current_web_contents->GetController(); - bool is_chrome_internal = HasInternalURL(nc.GetLastCommittedEntry()) || + bool is_chrome_internal = HasInternalURL(nc.GetActiveEntry()) || current_web_contents->ShowingInterstitialPage(); command_updater_.UpdateCommandEnabled(IDC_ENCODING_MENU, !is_chrome_internal && current_web_contents->IsSavable()); diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc index 9e67c60..dace355 100644 --- a/chrome/browser/ui/browser_commands.cc +++ b/chrome/browser/ui/browser_commands.cc @@ -256,10 +256,11 @@ int GetContentRestrictions(const Browser* browser) { CoreTabHelper* core_tab_helper = CoreTabHelper::FromWebContents(current_tab); content_restrictions = core_tab_helper->content_restrictions(); - NavigationEntry* entry = - current_tab->GetController().GetLastCommittedEntry(); + NavigationEntry* active_entry = + current_tab->GetController().GetActiveEntry(); // See comment in UpdateCommandsForTabState about why we call url(). - if (!content::IsSavableURL(entry ? entry->GetURL() : GURL()) || + if (!content::IsSavableURL( + active_entry ? active_entry->GetURL() : GURL()) || current_tab->ShowingInterstitialPage()) content_restrictions |= CONTENT_RESTRICTION_SAVE; if (current_tab->ShowingInterstitialPage()) @@ -987,7 +988,7 @@ void ToggleSpeechInput(Browser* browser) { bool CanRequestTabletSite(WebContents* current_tab) { if (!current_tab) return false; - return current_tab->GetController().GetLastCommittedEntry() != NULL; + return current_tab->GetController().GetActiveEntry() != NULL; } bool IsRequestingTabletSite(Browser* browser) { @@ -995,7 +996,7 @@ bool IsRequestingTabletSite(Browser* browser) { if (!current_tab) return false; content::NavigationEntry* entry = - current_tab->GetController().GetLastCommittedEntry(); + current_tab->GetController().GetActiveEntry(); if (!entry) return false; return entry->GetIsOverridingUserAgent(); @@ -1006,7 +1007,7 @@ void ToggleRequestTabletSite(Browser* browser) { if (!current_tab) return; NavigationController& controller = current_tab->GetController(); - NavigationEntry* entry = controller.GetLastCommittedEntry(); + NavigationEntry* entry = controller.GetActiveEntry(); if (!entry) return; if (entry->GetIsOverridingUserAgent()) { @@ -1061,25 +1062,25 @@ void ViewSource(Browser* browser, content::RecordAction(UserMetricsAction("ViewSource")); DCHECK(contents); - // Note that Clone does not copy the pending or transient entries, so we can - // take the last committed entry in view_source_contents. + // Note that Clone does not copy the pending or transient entries, so the + // active entry in view_source_contents will be the last committed entry. WebContents* view_source_contents = contents->Clone(); DCHECK(view_source_contents->GetController().CanPruneAllButLastCommitted()); view_source_contents->GetController().PruneAllButLastCommitted(); - NavigationEntry* entry = - view_source_contents->GetController().GetLastCommittedEntry(); - if (!entry) + NavigationEntry* active_entry = + view_source_contents->GetController().GetActiveEntry(); + if (!active_entry) return; GURL view_source_url = GURL(content::kViewSourceScheme + std::string(":") + url.spec()); - entry->SetVirtualURL(view_source_url); + active_entry->SetVirtualURL(view_source_url); // Do not restore scroller position. - entry->SetPageState(page_state.RemoveScrollOffset()); + active_entry->SetPageState(page_state.RemoveScrollOffset()); // Do not restore title, derive it from the url. - entry->SetTitle(base::string16()); + active_entry->SetTitle(string16()); // Now show view-source entry. if (browser->CanSupportWindowFeature(Browser::FEATURE_TABSTRIP)) { @@ -1150,7 +1151,7 @@ bool CanCreateApplicationShortcuts(const Browser* browser) { void ConvertTabToAppWindow(Browser* browser, content::WebContents* contents) { - const GURL& url = contents->GetController().GetLastCommittedEntry()->GetURL(); + const GURL& url = contents->GetController().GetActiveEntry()->GetURL(); std::string app_name = web_app::GenerateApplicationNameFromURL(url); int index = browser->tab_strip_model()->GetIndexOfWebContents(contents); |