diff options
author | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-21 07:31:11 +0000 |
---|---|---|
committer | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-21 07:31:11 +0000 |
commit | c70f9b84b30986220dc58993a9a41d6fdebefac2 (patch) | |
tree | bfd1dd487c509f9bfb65b065293d300c934b9282 /chrome/browser/tab_contents/navigation_controller.cc | |
parent | 2f312ab5f419b77456eba5e0362af3adaf94f6ad (diff) | |
download | chromium_src-c70f9b84b30986220dc58993a9a41d6fdebefac2.zip chromium_src-c70f9b84b30986220dc58993a9a41d6fdebefac2.tar.gz chromium_src-c70f9b84b30986220dc58993a9a41d6fdebefac2.tar.bz2 |
Close a newly opened (by cmd-clicking on a link) tab if it resulted in a download.
To test this, the CL adds an automation message AutomationMsg_NavigateAsyncWithDisposition, and a method NavigateToURLAsyncWithDisposition to TabProxy.
The only functional change is in TabContents::OnStartDownload, the rest of the changes is for testing.
BUG=10764
TEST=DownloadTest.CloseNewTab
Manual test: go to http://build.chromium.org/buildbot/continuous/mac/LATEST/, open the link "chrome-mac.zip" in a new tab. The tab should close as soon as the download starts.
Review URL: http://codereview.chromium.org/1151007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45158 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents/navigation_controller.cc')
-rw-r--r-- | chrome/browser/tab_contents/navigation_controller.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/chrome/browser/tab_contents/navigation_controller.cc b/chrome/browser/tab_contents/navigation_controller.cc index 141712f..c036c31 100644 --- a/chrome/browser/tab_contents/navigation_controller.cc +++ b/chrome/browser/tab_contents/navigation_controller.cc @@ -240,6 +240,10 @@ void NavigationController::ContinuePendingReload() { } } +bool NavigationController::IsInitialNavigation() { + return last_document_loaded_.is_null(); +} + NavigationEntry* NavigationController::GetEntryWithPageID( SiteInstance* instance, int32 page_id) const { int index = GetEntryIndexWithPageID(instance, page_id); |