OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/renderer_host/render_message_filter.h" | 5 #include "content/browser/renderer_host/render_message_filter.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 | 582 |
583 void RenderMessageFilter::OnGenerateRoutingID(int* route_id) { | 583 void RenderMessageFilter::OnGenerateRoutingID(int* route_id) { |
584 *route_id = render_widget_helper_->GetNextRoutingID(); | 584 *route_id = render_widget_helper_->GetNextRoutingID(); |
585 } | 585 } |
586 | 586 |
587 void RenderMessageFilter::OnDownloadUrl(const IPC::Message& message, | 587 void RenderMessageFilter::OnDownloadUrl(const IPC::Message& message, |
588 const GURL& url, | 588 const GURL& url, |
589 const GURL& referrer) { | 589 const GURL& referrer) { |
590 // Don't show "Save As" UI. | 590 // Don't show "Save As" UI. |
591 bool prompt_for_save_location = false; | 591 bool prompt_for_save_location = false; |
592 resource_dispatcher_host_->BeginDownload(url, | 592 resource_dispatcher_host_->BeginDownload( |
593 referrer, | 593 url, |
594 DownloadSaveInfo(), | 594 referrer, |
595 prompt_for_save_location, | 595 DownloadSaveInfo(), |
596 render_process_id_, | 596 prompt_for_save_location, |
597 message.routing_id(), | 597 "GET"/*method*/, |
598 resource_context_); | 598 NULL/*extra_headers*/, |
| 599 ""/*post_body*/, |
| 600 DownloadResourceHandler::OnResponseStartedCallback(), |
| 601 DownloadResourceHandler::OnUnstartableCallback(), |
| 602 render_process_id_, |
| 603 message.routing_id(), |
| 604 resource_context_); |
599 download_util::RecordDownloadCount( | 605 download_util::RecordDownloadCount( |
600 download_util::INITIATED_BY_RENDERER_COUNT); | 606 download_util::INITIATED_BY_RENDERER_COUNT); |
601 } | 607 } |
602 | 608 |
603 void RenderMessageFilter::OnCheckNotificationPermission( | 609 void RenderMessageFilter::OnCheckNotificationPermission( |
604 const GURL& source_url, int* result) { | 610 const GURL& source_url, int* result) { |
605 *result = content::GetContentClient()->browser()-> | 611 *result = content::GetContentClient()->browser()-> |
606 CheckDesktopNotificationPermission(source_url, resource_context_); | 612 CheckDesktopNotificationPermission(source_url, resource_context_); |
607 } | 613 } |
608 | 614 |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 file_for_transit = base::FileDescriptor(file, true); | 858 file_for_transit = base::FileDescriptor(file, true); |
853 #endif | 859 #endif |
854 } | 860 } |
855 | 861 |
856 IPC::Message* reply = new ViewMsg_AsyncOpenFile_ACK( | 862 IPC::Message* reply = new ViewMsg_AsyncOpenFile_ACK( |
857 routing_id, error_code, file_for_transit, message_id); | 863 routing_id, error_code, file_for_transit, message_id); |
858 BrowserThread::PostTask( | 864 BrowserThread::PostTask( |
859 BrowserThread::IO, FROM_HERE, NewRunnableMethod( | 865 BrowserThread::IO, FROM_HERE, NewRunnableMethod( |
860 this, &RenderMessageFilter::Send, reply)); | 866 this, &RenderMessageFilter::Send, reply)); |
861 } | 867 } |
OLD | NEW |