OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 media::AudioManagerBase::kDefaultDeviceId); | 874 media::AudioManagerBase::kDefaultDeviceId); |
875 } | 875 } |
876 | 876 |
877 #if defined(OS_WIN) | 877 #if defined(OS_WIN) |
878 void RenderMessageFilter::OnGetMonitorColorProfile(std::vector<char>* profile) { | 878 void RenderMessageFilter::OnGetMonitorColorProfile(std::vector<char>* profile) { |
879 DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::IO)); | 879 DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::IO)); |
880 *profile = g_color_profile.Get().profile(); | 880 *profile = g_color_profile.Get().profile(); |
881 } | 881 } |
882 #endif | 882 #endif |
883 | 883 |
884 void RenderMessageFilter::OnDownloadUrl(const IPC::Message& message, | 884 void RenderMessageFilter::OnDownloadUrl(int render_view_id, |
885 const GURL& url, | 885 const GURL& url, |
886 const Referrer& referrer, | 886 const Referrer& referrer, |
887 const base::string16& suggested_name, | 887 const base::string16& suggested_name, |
888 const bool use_prompt) { | 888 const bool use_prompt) { |
889 scoped_ptr<DownloadSaveInfo> save_info(new DownloadSaveInfo()); | 889 scoped_ptr<DownloadSaveInfo> save_info(new DownloadSaveInfo()); |
890 save_info->suggested_name = suggested_name; | 890 save_info->suggested_name = suggested_name; |
891 save_info->prompt_for_save_location = use_prompt; | 891 save_info->prompt_for_save_location = use_prompt; |
892 | 892 |
893 // There may be a special cookie store that we could use for this download, | 893 // There may be a special cookie store that we could use for this download, |
894 // rather than the default one. Since this feature is generally only used for | 894 // rather than the default one. Since this feature is generally only used for |
895 // proper render views, and not downloads, we do not need to retrieve the | 895 // proper render views, and not downloads, we do not need to retrieve the |
896 // special cookie store here, but just initialize the request to use the | 896 // special cookie store here, but just initialize the request to use the |
897 // default cookie store. | 897 // default cookie store. |
898 // TODO(tburkard): retrieve the appropriate special cookie store, if this | 898 // TODO(tburkard): retrieve the appropriate special cookie store, if this |
899 // is ever to be used for downloads as well. | 899 // is ever to be used for downloads as well. |
900 scoped_ptr<net::URLRequest> request( | 900 scoped_ptr<net::URLRequest> request( |
901 resource_context_->GetRequestContext()->CreateRequest( | 901 resource_context_->GetRequestContext()->CreateRequest( |
902 url, net::DEFAULT_PRIORITY, NULL, NULL)); | 902 url, net::DEFAULT_PRIORITY, NULL, NULL)); |
903 RecordDownloadSource(INITIATED_BY_RENDERER); | 903 RecordDownloadSource(INITIATED_BY_RENDERER); |
904 resource_dispatcher_host_->BeginDownload( | 904 resource_dispatcher_host_->BeginDownload( |
905 request.Pass(), | 905 request.Pass(), |
906 referrer, | 906 referrer, |
907 true, // is_content_initiated | 907 true, // is_content_initiated |
908 resource_context_, | 908 resource_context_, |
909 render_process_id_, | 909 render_process_id_, |
910 message.routing_id(), | 910 render_view_id, |
911 false, | 911 false, |
912 save_info.Pass(), | 912 save_info.Pass(), |
913 content::DownloadItem::kInvalidId, | 913 content::DownloadItem::kInvalidId, |
914 ResourceDispatcherHostImpl::DownloadStartedCallback()); | 914 ResourceDispatcherHostImpl::DownloadStartedCallback()); |
915 } | 915 } |
916 | 916 |
917 void RenderMessageFilter::OnCheckNotificationPermission( | 917 void RenderMessageFilter::OnCheckNotificationPermission( |
918 const GURL& source_origin, int* result) { | 918 const GURL& source_origin, int* result) { |
919 #if defined(ENABLE_NOTIFICATIONS) | 919 #if defined(ENABLE_NOTIFICATIONS) |
920 *result = GetContentClient()->browser()-> | 920 *result = GetContentClient()->browser()-> |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1317 return; | 1317 return; |
1318 } | 1318 } |
1319 } | 1319 } |
1320 #endif | 1320 #endif |
1321 | 1321 |
1322 GpuMemoryBufferImpl::AllocateForChildProcess( | 1322 GpuMemoryBufferImpl::AllocateForChildProcess( |
1323 gfx::Size(width, height), internalformat, usage, PeerHandle(), handle); | 1323 gfx::Size(width, height), internalformat, usage, PeerHandle(), handle); |
1324 } | 1324 } |
1325 | 1325 |
1326 } // namespace content | 1326 } // namespace content |
OLD | NEW |