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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 } | 407 } |
408 | 408 |
409 // Generate name for saving resource. | 409 // Generate name for saving resource. |
410 bool SavePackage::GenerateFileName(const std::string& disposition, | 410 bool SavePackage::GenerateFileName(const std::string& disposition, |
411 const GURL& url, | 411 const GURL& url, |
412 bool need_html_ext, | 412 bool need_html_ext, |
413 FilePath::StringType* generated_name) { | 413 FilePath::StringType* generated_name) { |
414 // TODO(jungshik): Figure out the referrer charset when having one | 414 // TODO(jungshik): Figure out the referrer charset when having one |
415 // makes sense and pass it to GetSuggestedFilename. | 415 // makes sense and pass it to GetSuggestedFilename. |
416 string16 suggested_name = | 416 string16 suggested_name = |
417 net::GetSuggestedFilename(url, disposition, "", | 417 net::GetSuggestedFilename(url, disposition, "", "", |
418 ASCIIToUTF16(kDefaultSaveName)); | 418 ASCIIToUTF16(kDefaultSaveName)); |
419 | 419 |
420 // TODO(evan): this code is totally wrong -- we should just generate | 420 // TODO(evan): this code is totally wrong -- we should just generate |
421 // Unicode filenames and do all this encoding switching at the end. | 421 // Unicode filenames and do all this encoding switching at the end. |
422 // However, I'm just shuffling wrong code around, at least not adding | 422 // However, I'm just shuffling wrong code around, at least not adding |
423 // to it. | 423 // to it. |
424 #if defined(OS_WIN) | 424 #if defined(OS_WIN) |
425 FilePath file_path = FilePath(suggested_name); | 425 FilePath file_path = FilePath(suggested_name); |
426 #else | 426 #else |
427 FilePath file_path = FilePath( | 427 FilePath file_path = FilePath( |
(...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1462 } | 1462 } |
1463 | 1463 |
1464 // SelectFileDialog::Listener interface. | 1464 // SelectFileDialog::Listener interface. |
1465 void SavePackage::FileSelected(const FilePath& path, | 1465 void SavePackage::FileSelected(const FilePath& path, |
1466 int index, void* params) { | 1466 int index, void* params) { |
1467 ContinueSave(path, index); | 1467 ContinueSave(path, index); |
1468 } | 1468 } |
1469 | 1469 |
1470 void SavePackage::FileSelectionCanceled(void* params) { | 1470 void SavePackage::FileSelectionCanceled(void* params) { |
1471 } | 1471 } |
OLD | NEW |