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

Side by Side Diff: content/browser/web_contents/web_contents_drag_win.cc

Issue 99923002: Move temp file functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | Annotate | Revision Log
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/web_contents/web_contents_drag_win.h" 5 #include "content/browser/web_contents/web_contents_drag_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 std::string default_name = 240 std::string default_name =
241 GetContentClient()->browser()->GetDefaultDownloadName(); 241 GetContentClient()->browser()->GetDefaultDownloadName();
242 base::FilePath generated_download_file_name = 242 base::FilePath generated_download_file_name =
243 net::GenerateFileName(download_url, 243 net::GenerateFileName(download_url,
244 std::string(), 244 std::string(),
245 std::string(), 245 std::string(),
246 UTF16ToUTF8(file_name.value()), 246 UTF16ToUTF8(file_name.value()),
247 UTF16ToUTF8(mime_type), 247 UTF16ToUTF8(mime_type),
248 default_name); 248 default_name);
249 base::FilePath temp_dir_path; 249 base::FilePath temp_dir_path;
250 if (!file_util::CreateNewTempDirectory( 250 if (!base::CreateNewTempDirectory(FILE_PATH_LITERAL("chrome_drag"),
251 FILE_PATH_LITERAL("chrome_drag"), &temp_dir_path)) 251 &temp_dir_path))
252 return; 252 return;
253 base::FilePath download_path = 253 base::FilePath download_path =
254 temp_dir_path.Append(generated_download_file_name); 254 temp_dir_path.Append(generated_download_file_name);
255 255
256 // We cannot know when the target application will be done using the temporary 256 // We cannot know when the target application will be done using the temporary
257 // file, so schedule it to be deleted after rebooting. 257 // file, so schedule it to be deleted after rebooting.
258 base::DeleteFileAfterReboot(download_path); 258 base::DeleteFileAfterReboot(download_path);
259 base::DeleteFileAfterReboot(temp_dir_path); 259 base::DeleteFileAfterReboot(temp_dir_path);
260 260
261 // Provide the data as file (CF_HDROP). A temporary download file with the 261 // Provide the data as file (CF_HDROP). A temporary download file with the
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 FROM_HERE, 434 FROM_HERE,
435 base::Bind(&WebContentsDragWin::CloseThread, this)); 435 base::Bind(&WebContentsDragWin::CloseThread, this));
436 } 436 }
437 437
438 // static 438 // static
439 void WebContentsDragWin::DisableDragDropForTesting() { 439 void WebContentsDragWin::DisableDragDropForTesting() {
440 run_do_drag_drop = false; 440 run_do_drag_drop = false;
441 } 441 }
442 442
443 } // namespace content 443 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/tracing/tracing_controller_impl.cc ('k') | content/child/npapi/plugin_stream_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698