summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-17 19:36:52 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-17 19:36:52 +0000
commita0729671be0628b5d2c45ef9c19a51c53bfa65b5 (patch)
tree5e4fadde19f6c5702a799cc3b786fee48fc4c9c0 /chrome/browser/download
parent39ae0a282dc3c1b9e1aea492e11c4d1439ac6921 (diff)
downloadchromium_src-a0729671be0628b5d2c45ef9c19a51c53bfa65b5.zip
chromium_src-a0729671be0628b5d2c45ef9c19a51c53bfa65b5.tar.gz
chromium_src-a0729671be0628b5d2c45ef9c19a51c53bfa65b5.tar.bz2
Revamp of the interstitial pages.
The interstitial is now a RVH that is displayed on top of the WebContents with no interaction with the WebContents' RenderViewHostManager. This simplifies the states that the RenderViewHostManager has. The interstitial is responsible for hiding and deleting itself when told to proceed/not proceed or when a navigation occurs or the tab is closed. The interstitial now uses a data URL (instead of loading some alternate HTML), which allowed me to remove some interstitial flags from NavigationController::LoadCommittedDetails and ProvisionalLoadDetails. Also changed tab_utils::GetTabContentsByID to return a WebContents since only WebContents have a RVH associated with them. TEST=Run all ui tests and unit tests. Review URL: http://codereview.chromium.org/13764 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7149 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download')
-rw-r--r--chrome/browser/download/download_file.cc6
-rw-r--r--chrome/browser/download/download_manager.cc4
-rw-r--r--chrome/browser/download/download_request_manager.cc6
-rw-r--r--chrome/browser/download/save_file_manager.cc10
4 files changed, 11 insertions, 15 deletions
diff --git a/chrome/browser/download/download_file.cc b/chrome/browser/download/download_file.cc
index f921661..2a5e612 100644
--- a/chrome/browser/download/download_file.cc
+++ b/chrome/browser/download/download_file.cc
@@ -16,8 +16,8 @@
#include "chrome/browser/download/download_manager.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/resource_dispatcher_host.h"
-#include "chrome/browser/tab_contents.h"
#include "chrome/browser/tab_util.h"
+#include "chrome/browser/web_contents.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/stl_util-inl.h"
#include "chrome/common/win_util.h"
@@ -458,9 +458,9 @@ void DownloadFileManager::RemoveDownload(int id, DownloadManager* manager) {
// static
DownloadManager* DownloadFileManager::DownloadManagerFromRenderIds(
int render_process_id, int render_view_id) {
- TabContents* contents = tab_util::GetTabContentsByID(render_process_id,
+ WebContents* contents = tab_util::GetWebContentsByID(render_process_id,
render_view_id);
- if (contents && contents->type() == TAB_CONTENTS_WEB) {
+ if (contents) {
Profile* profile = contents->profile();
if (profile)
return profile->GetDownloadManager();
diff --git a/chrome/browser/download/download_manager.cc b/chrome/browser/download/download_manager.cc
index 5328807..adf62d3 100644
--- a/chrome/browser/download/download_manager.cc
+++ b/chrome/browser/download/download_manager.cc
@@ -618,7 +618,7 @@ void DownloadManager::OnPathExistenceAvailable(DownloadCreateInfo* info) {
if (!select_file_dialog_.get())
select_file_dialog_ = SelectFileDialog::Create(this);
- TabContents* contents = tab_util::GetTabContentsByID(
+ WebContents* contents = tab_util::GetWebContentsByID(
info->render_process_id, info->render_view_id);
std::wstring filter = win_util::GetFileFilterFromPath(info->suggested_path);
HWND owning_hwnd =
@@ -1308,7 +1308,7 @@ void DownloadManager::OnCreateDownloadEntryComplete(DownloadCreateInfo info,
// this start completion event. If it does, tell the origin WebContents to
// display its download shelf.
TabContents* contents =
- tab_util::GetTabContentsByID(info.render_process_id, info.render_view_id);
+ tab_util::GetWebContentsByID(info.render_process_id, info.render_view_id);
// If the contents no longer exists or is no longer active, we start the
// download in the last active browser. This is not ideal but better than
diff --git a/chrome/browser/download/download_request_manager.cc b/chrome/browser/download/download_request_manager.cc
index 6869d6e..ac4cdb5 100644
--- a/chrome/browser/download/download_request_manager.cc
+++ b/chrome/browser/download/download_request_manager.cc
@@ -9,9 +9,9 @@
#include "chrome/browser/navigation_controller.h"
#include "chrome/browser/navigation_entry.h"
#include "chrome/browser/constrained_window.h"
-#include "chrome/browser/tab_contents.h"
#include "chrome/browser/tab_contents_delegate.h"
#include "chrome/browser/tab_util.h"
+#include "chrome/browser/web_contents.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/notification_registrar.h"
#include "chrome/common/notification_service.h"
@@ -409,8 +409,8 @@ void DownloadRequestManager::CanDownload(int render_process_host_id,
Callback* callback) {
DCHECK(!ui_loop_ || MessageLoop::current() == ui_loop_);
- TabContents* originating_tab =
- tab_util::GetTabContentsByID(render_process_host_id, render_view_id);
+ WebContents* originating_tab =
+ tab_util::GetWebContentsByID(render_process_host_id, render_view_id);
if (!originating_tab) {
// The tab was closed, don't allow the download.
ScheduleNotification(callback, false);
diff --git a/chrome/browser/download/save_file_manager.cc b/chrome/browser/download/save_file_manager.cc
index 940e878..631b55d 100644
--- a/chrome/browser/download/save_file_manager.cc
+++ b/chrome/browser/download/save_file_manager.cc
@@ -215,14 +215,10 @@ void SaveFileManager::RemoveSaveFile(int save_id, const std::wstring& save_url,
// only on the UI thread.
SavePackage* SaveFileManager::GetSavePackageFromRenderIds(
int render_process_id, int render_view_id) {
- TabContents* contents = tab_util::GetTabContentsByID(render_process_id,
+ WebContents* contents = tab_util::GetWebContentsByID(render_process_id,
render_view_id);
- if (contents && contents->type() == TAB_CONTENTS_WEB) {
- // Convert const pointer of WebContents to pointer of WebContents.
- const WebContents* web_contents = contents->AsWebContents();
- if (web_contents)
- return web_contents->save_package();
- }
+ if (contents)
+ return contents->save_package();
return NULL;
}