summaryrefslogtreecommitdiffstats
path: root/chrome/browser/render_view_host.cc
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-25 22:11:06 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-25 22:11:06 +0000
commit1f5af444f94761190a16ac6088ad6e6831aeb4a0 (patch)
tree6c89513715320dacc744a49e0e2104a4ee3e9807 /chrome/browser/render_view_host.cc
parentde8d2667d6953abb31b7c5385ca718ad47adf6a1 (diff)
downloadchromium_src-1f5af444f94761190a16ac6088ad6e6831aeb4a0.zip
chromium_src-1f5af444f94761190a16ac6088ad6e6831aeb4a0.tar.gz
chromium_src-1f5af444f94761190a16ac6088ad6e6831aeb4a0.tar.bz2
Move a bunch of stuff out of WebContents. I removed a bunch of render view host pass-throughs and just made the callers call the render view host directly. I don't think we're trying to isolate the layers to this degree, and WebContents is so big these just added noise.
I removed the RenderViewHost->WebContents->SavePackage pass-through by using a delegate that the SavePackage implements (like we already do for find in page). I also noticed some file upload stuff wasn't used at all and removed it. Review URL: http://codereview.chromium.org/4088 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2612 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/render_view_host.cc')
-rw-r--r--chrome/browser/render_view_host.cc34
1 files changed, 11 insertions, 23 deletions
diff --git a/chrome/browser/render_view_host.cc b/chrome/browser/render_view_host.cc
index 27b25c9..9128c87 100644
--- a/chrome/browser/render_view_host.cc
+++ b/chrome/browser/render_view_host.cc
@@ -307,6 +307,9 @@ void RenderViewHost::StartFinding(int request_id,
bool forward,
bool match_case,
bool find_next) {
+ if (search_string.empty())
+ return;
+
FindInPageRequest request;
request.request_id = request_id;
request.search_string = search_string;
@@ -373,25 +376,6 @@ void RenderViewHost::DragTargetDrop(
Send(new ViewMsg_DragTargetDrop(routing_id_, client_pt, screen_pt));
}
-void RenderViewHost::UploadFile(const std::wstring& file_path,
- const std::wstring& form,
- const std::wstring& file,
- const std::wstring& submit,
- const std::wstring& other_values) {
- if (!process_->channel())
- return;
-
- RendererSecurityPolicy::GetInstance()->GrantUploadFile(process()->host_id(),
- file);
- ViewMsg_UploadFile_Params p;
- p.file_path = file_path;
- p.form = form;
- p.file = file;
- p.submit = submit;
- p.other_values = other_values;
- Send(new ViewMsg_UploadFile(routing_id_, p));
-}
-
void RenderViewHost::ReservePageIDRange(int size) {
Send(new ViewMsg_ReservePageIDRange(routing_id_, size));
}
@@ -1140,9 +1124,11 @@ void RenderViewHost::OnReceivedSavableResourceLinksForCurrentPage(
const std::vector<GURL>& resources_list,
const std::vector<GURL>& referrers_list,
const std::vector<GURL>& frames_list) {
- delegate_->OnReceivedSavableResourceLinksForCurrentPage(resources_list,
- referrers_list,
- frames_list);
+ RenderViewHostDelegate::Save* save_delegate = delegate_->GetSaveDelegate();
+ if (save_delegate) {
+ save_delegate->OnReceivedSavableResourceLinksForCurrentPage(
+ resources_list, referrers_list, frames_list);
+ }
}
void RenderViewHost::OnDidGetApplicationInfo(
@@ -1162,7 +1148,9 @@ void RenderViewHost::GetSerializedHtmlDataForCurrentPageWithLocalLinks(
void RenderViewHost::OnReceivedSerializedHtmlData(const GURL& frame_url,
const std::string& data,
int32 status) {
- delegate_->OnReceivedSerializedHtmlData(frame_url, data, status);
+ RenderViewHostDelegate::Save* save_delegate = delegate_->GetSaveDelegate();
+ if (save_delegate)
+ save_delegate->OnReceivedSerializedHtmlData(frame_url, data, status);
}
void RenderViewHost::OnMsgShouldCloseACK(bool proceed) {