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 "chrome/browser/download/save_package.h" | 5 #include "chrome/browser/download/save_package.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 } | 412 } |
413 | 413 |
414 // Generate name for saving resource. | 414 // Generate name for saving resource. |
415 bool SavePackage::GenerateFileName(const std::string& disposition, | 415 bool SavePackage::GenerateFileName(const std::string& disposition, |
416 const GURL& url, | 416 const GURL& url, |
417 bool need_html_ext, | 417 bool need_html_ext, |
418 FilePath::StringType* generated_name) { | 418 FilePath::StringType* generated_name) { |
419 // TODO(jungshik): Figure out the referrer charset when having one | 419 // TODO(jungshik): Figure out the referrer charset when having one |
420 // makes sense and pass it to GetSuggestedFilename. | 420 // makes sense and pass it to GetSuggestedFilename. |
421 string16 suggested_name = | 421 string16 suggested_name = |
422 net::GetSuggestedFilename(url, disposition, "", | 422 net::GetSuggestedFilename(url, disposition, "", "", |
423 ASCIIToUTF16(kDefaultSaveName)); | 423 ASCIIToUTF16(kDefaultSaveName)); |
424 | 424 |
425 // TODO(evan): this code is totally wrong -- we should just generate | 425 // TODO(evan): this code is totally wrong -- we should just generate |
426 // Unicode filenames and do all this encoding switching at the end. | 426 // Unicode filenames and do all this encoding switching at the end. |
427 // However, I'm just shuffling wrong code around, at least not adding | 427 // However, I'm just shuffling wrong code around, at least not adding |
428 // to it. | 428 // to it. |
429 #if defined(OS_WIN) | 429 #if defined(OS_WIN) |
430 FilePath file_path = FilePath(suggested_name); | 430 FilePath file_path = FilePath(suggested_name); |
431 #else | 431 #else |
432 FilePath file_path = FilePath( | 432 FilePath file_path = FilePath( |
(...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1467 } | 1467 } |
1468 | 1468 |
1469 // SelectFileDialog::Listener interface. | 1469 // SelectFileDialog::Listener interface. |
1470 void SavePackage::FileSelected(const FilePath& path, | 1470 void SavePackage::FileSelected(const FilePath& path, |
1471 int index, void* params) { | 1471 int index, void* params) { |
1472 ContinueSave(path, index); | 1472 ContinueSave(path, index); |
1473 } | 1473 } |
1474 | 1474 |
1475 void SavePackage::FileSelectionCanceled(void* params) { | 1475 void SavePackage::FileSelectionCanceled(void* params) { |
1476 } | 1476 } |
OLD | NEW |