summaryrefslogtreecommitdiffstats
path: root/chrome/browser/instant
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-16 16:07:46 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-16 16:07:46 +0000
commit357284ba336a2fe71a84bc9456c71a169bad4c6e (patch)
tree74a27b413bec45038f3f3c2bf5f71a88b86126c8 /chrome/browser/instant
parentb0e459c0b93cd47911ff126ebd78495e1f92383f (diff)
downloadchromium_src-357284ba336a2fe71a84bc9456c71a169bad4c6e.zip
chromium_src-357284ba336a2fe71a84bc9456c71a169bad4c6e.tar.gz
chromium_src-357284ba336a2fe71a84bc9456c71a169bad4c6e.tar.bz2
Revert 85486 - Move download stuff to download tab helper.
BUG=71097 TEST=zero visible change in how the download system works Review URL: http://codereview.chromium.org/6973035 TBR=avi@chromium.org Review URL: http://codereview.chromium.org/7030015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85491 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/instant')
-rw-r--r--chrome/browser/instant/instant_loader.cc31
1 files changed, 8 insertions, 23 deletions
diff --git a/chrome/browser/instant/instant_loader.cc b/chrome/browser/instant/instant_loader.cc
index f686ecb..ca99bea 100644
--- a/chrome/browser/instant/instant_loader.cc
+++ b/chrome/browser/instant/instant_loader.cc
@@ -21,8 +21,6 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h"
-#include "chrome/browser/ui/download/download_tab_helper.h"
-#include "chrome/browser/ui/download/download_tab_helper_delegate.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/render_messages.h"
@@ -144,8 +142,7 @@ void InstantLoader::FrameLoadObserver::Observe(
class InstantLoader::TabContentsDelegateImpl
: public TabContentsDelegate,
public NotificationObserver,
- public TabContentsObserver,
- public DownloadTabHelperDelegate {
+ public TabContentsObserver {
public:
explicit TabContentsDelegateImpl(InstantLoader* loader);
@@ -211,6 +208,7 @@ class InstantLoader::TabContentsDelegateImpl
// instant result when the drag ends, so that during the drag the page won't
// move around.
virtual void DragEnded() OVERRIDE;
+ virtual bool CanDownload(int request_id) OVERRIDE;
virtual void HandleMouseUp() OVERRIDE;
virtual void HandleMouseActivate() OVERRIDE;
virtual bool OnGoToEntryOffset(int offset) OVERRIDE;
@@ -222,11 +220,6 @@ class InstantLoader::TabContentsDelegateImpl
// TabContentsObserver:
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
- // DownloadTabHelperDelegate:
- virtual bool CanDownload(int request_id) OVERRIDE;
- virtual void OnStartDownload(DownloadItem* download,
- TabContentsWrapper* tab) OVERRIDE;
-
private:
typedef std::vector<scoped_refptr<history::HistoryAddPageArgs> >
AddPageVector;
@@ -518,6 +511,11 @@ void InstantLoader::TabContentsDelegateImpl::DragEnded() {
CommitFromMouseReleaseIfNecessary();
}
+bool InstantLoader::TabContentsDelegateImpl::CanDownload(int request_id) {
+ // Downloads are disabled.
+ return false;
+}
+
void InstantLoader::TabContentsDelegateImpl::HandleMouseUp() {
CommitFromMouseReleaseIfNecessary();
}
@@ -562,16 +560,6 @@ bool InstantLoader::TabContentsDelegateImpl::OnMessageReceived(
return handled;
}
-bool InstantLoader::TabContentsDelegateImpl::CanDownload(int request_id) {
- // Downloads are disabled.
- return false;
-}
-
-void InstantLoader::TabContentsDelegateImpl::OnStartDownload(
- DownloadItem* download, TabContentsWrapper* tab) {
- // Downloads are disabled.
-}
-
void InstantLoader::TabContentsDelegateImpl::OnSetSuggestions(
int32 page_id,
const std::vector<std::string>& suggestions,
@@ -822,7 +810,6 @@ TabContentsWrapper* InstantLoader::ReleasePreviewContents(
#endif
}
preview_contents_->tab_contents()->set_delegate(NULL);
- preview_contents_->download_tab_helper()->set_delegate(NULL);
ready_ = false;
}
update_bounds_timer_.Stop();
@@ -985,7 +972,7 @@ void InstantLoader::SendBoundsToPage(bool force_if_waiting) {
if (preview_contents_.get() && is_showing_instant() &&
(force_if_waiting || !is_waiting_for_load())) {
last_omnibox_bounds_ = omnibox_bounds_;
- RenderViewHost* host = preview_contents_->render_view_host();
+ RenderViewHost*host = preview_contents_->render_view_host();
host->Send(new ViewMsg_SearchBoxResize(
host->routing_id(), GetOmniboxBoundsInTermsOfPreview()));
}
@@ -1006,8 +993,6 @@ void InstantLoader::CreatePreviewContents(TabContentsWrapper* tab_contents) {
preview_tab_contents_delegate_.reset(new TabContentsDelegateImpl(this));
new_contents->set_delegate(preview_tab_contents_delegate_.get());
- preview_contents_->download_tab_helper()->set_delegate(
- preview_tab_contents_delegate_.get());
gfx::Rect tab_bounds;
tab_contents->view()->GetContainerBounds(&tab_bounds);