Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Side by Side Diff: content/browser/renderer_host/render_message_filter.cc

Issue 263453007: Implement "Save image as" for canvas (chromium side). (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 874 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 } 885 }
886 if (enabled) 886 if (enabled)
887 return; 887 return;
888 *profile = g_color_profile.Get().profile(); 888 *profile = g_color_profile.Get().profile();
889 } 889 }
890 #endif 890 #endif
891 891
892 void RenderMessageFilter::OnDownloadUrl(const IPC::Message& message, 892 void RenderMessageFilter::OnDownloadUrl(const IPC::Message& message,
893 const GURL& url, 893 const GURL& url,
894 const Referrer& referrer, 894 const Referrer& referrer,
895 const base::string16& suggested_name) { 895 const base::string16& suggested_name,
896 const bool use_prompt) {
896 scoped_ptr<DownloadSaveInfo> save_info(new DownloadSaveInfo()); 897 scoped_ptr<DownloadSaveInfo> save_info(new DownloadSaveInfo());
897 save_info->suggested_name = suggested_name; 898 save_info->suggested_name = suggested_name;
899 save_info->prompt_for_save_location = use_prompt;
898 900
899 // There may be a special cookie store that we could use for this download, 901 // There may be a special cookie store that we could use for this download,
900 // rather than the default one. Since this feature is generally only used for 902 // rather than the default one. Since this feature is generally only used for
901 // proper render views, and not downloads, we do not need to retrieve the 903 // proper render views, and not downloads, we do not need to retrieve the
902 // special cookie store here, but just initialize the request to use the 904 // special cookie store here, but just initialize the request to use the
903 // default cookie store. 905 // default cookie store.
904 // TODO(tburkard): retrieve the appropriate special cookie store, if this 906 // TODO(tburkard): retrieve the appropriate special cookie store, if this
905 // is ever to be used for downloads as well. 907 // is ever to be used for downloads as well.
906 scoped_ptr<net::URLRequest> request( 908 scoped_ptr<net::URLRequest> request(
907 resource_context_->GetRequestContext()->CreateRequest( 909 resource_context_->GetRequestContext()->CreateRequest(
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
1335 } 1337 }
1336 1338
1337 // Fallback to fake GpuMemoryBuffer that is backed by shared memory and 1339 // Fallback to fake GpuMemoryBuffer that is backed by shared memory and
1338 // requires an upload before it can be used as a texture. 1340 // requires an upload before it can be used as a texture.
1339 handle->type = gfx::SHARED_MEMORY_BUFFER; 1341 handle->type = gfx::SHARED_MEMORY_BUFFER;
1340 ChildProcessHostImpl::AllocateSharedMemory( 1342 ChildProcessHostImpl::AllocateSharedMemory(
1341 static_cast<size_t>(buffer_size), PeerHandle(), &handle->handle); 1343 static_cast<size_t>(buffer_size), PeerHandle(), &handle->handle);
1342 } 1344 }
1343 1345
1344 } // namespace content 1346 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_message_filter.h ('k') | content/browser/renderer_host/render_view_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698