| 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 "chrome/browser/download/save_package_file_picker.h" | 5 #include "chrome/browser/download/save_package_file_picker.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/i18n/file_util_icu.h" | 9 #include "base/i18n/file_util_icu.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 if (!extra_extension.empty()) | 108 if (!extra_extension.empty()) |
| 109 extensions.push_back(extra_extension); | 109 extensions.push_back(extra_extension); |
| 110 file_type_info->extensions.push_back(extensions); | 110 file_type_info->extensions.push_back(extensions); |
| 111 } | 111 } |
| 112 #endif | 112 #endif |
| 113 | 113 |
| 114 } // anonymous namespace | 114 } // anonymous namespace |
| 115 | 115 |
| 116 bool SavePackageFilePicker::ShouldSaveAsMHTML() const { | 116 bool SavePackageFilePicker::ShouldSaveAsMHTML() const { |
| 117 #if !defined(OS_CHROMEOS) | 117 #if !defined(OS_CHROMEOS) |
| 118 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 118 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 119 switches::kSavePageAsMHTML)) | 119 switches::kSavePageAsMHTML)) |
| 120 return false; | 120 return false; |
| 121 #endif | 121 #endif |
| 122 return can_save_as_complete_; | 122 return can_save_as_complete_; |
| 123 } | 123 } |
| 124 | 124 |
| 125 SavePackageFilePicker::SavePackageFilePicker( | 125 SavePackageFilePicker::SavePackageFilePicker( |
| 126 content::WebContents* web_contents, | 126 content::WebContents* web_contents, |
| 127 const base::FilePath& suggested_path, | 127 const base::FilePath& suggested_path, |
| 128 const base::FilePath::StringType& default_extension, | 128 const base::FilePath::StringType& default_extension, |
| 129 bool can_save_as_complete, | 129 bool can_save_as_complete, |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 } | 279 } |
| 280 #endif | 280 #endif |
| 281 | 281 |
| 282 callback_.Run(path_copy, save_type, | 282 callback_.Run(path_copy, save_type, |
| 283 base::Bind(&OnSavePackageDownloadCreated)); | 283 base::Bind(&OnSavePackageDownloadCreated)); |
| 284 } | 284 } |
| 285 | 285 |
| 286 void SavePackageFilePicker::FileSelectionCanceled(void* unused_params) { | 286 void SavePackageFilePicker::FileSelectionCanceled(void* unused_params) { |
| 287 delete this; | 287 delete this; |
| 288 } | 288 } |
| OLD | NEW |