Chromium Code Reviews| 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/chromeos/file_manager/open_util.h" | 5 #include "chrome/browser/chromeos/file_manager/open_util.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 135 profile, | 135 profile, |
| 136 path, | 136 path, |
| 137 base::Bind(&OpenFileWithMimeType, profile, path, url, callback)); | 137 base::Bind(&OpenFileWithMimeType, profile, path, url, callback)); |
| 138 } | 138 } |
| 139 | 139 |
| 140 // Called when execution of ContinueOpenItem() is completed. | 140 // Called when execution of ContinueOpenItem() is completed. |
| 141 void OnContinueOpenItemCompleted(Profile* profile, | 141 void OnContinueOpenItemCompleted(Profile* profile, |
| 142 const base::FilePath& file_path, | 142 const base::FilePath& file_path, |
| 143 bool result) { | 143 bool result) { |
| 144 if (!result) { | 144 if (!result) { |
| 145 ShowWarningMessageBox( | 145 int message; |
| 146 profile, file_path, IDS_FILE_BROWSER_ERROR_VIEWING_FILE); | 146 if (file_path.Extension() == ".dmg") |
|
kinaba
2014/09/11 08:50:41
FILE_PATH_LITERAL(".dmg")
base::FilePath holds UT
iseki
2014/09/11 09:18:58
Done.
| |
| 147 message = IDS_FILE_BROWSER_ERROR_VIEWING_FILE_FOR_DMG; | |
| 148 else if (file_path.Extension() == ".exe") | |
|
kinaba
2014/09/11 08:50:41
Would you mind checking ".msi" and returning the s
iseki
2014/09/11 09:18:58
Done.
| |
| 149 message = IDS_FILE_BROWSER_ERROR_VIEWING_FILE_FOR_EXECUTABLE; | |
| 150 else | |
| 151 message = IDS_FILE_BROWSER_ERROR_VIEWING_FILE; | |
| 152 ShowWarningMessageBox(profile, file_path, message); | |
| 147 } | 153 } |
| 148 } | 154 } |
| 149 | 155 |
| 150 // Used to implement OpenItem(). | 156 // Used to implement OpenItem(). |
| 151 void ContinueOpenItem(Profile* profile, | 157 void ContinueOpenItem(Profile* profile, |
| 152 const base::FilePath& file_path, | 158 const base::FilePath& file_path, |
| 153 const GURL& url, | 159 const GURL& url, |
| 154 base::File::Error error) { | 160 base::File::Error error) { |
| 155 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 161 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 156 | 162 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 224 GURL url; | 230 GURL url; |
| 225 if (!ConvertPath(profile, file_path, &converted_path, &url)) | 231 if (!ConvertPath(profile, file_path, &converted_path, &url)) |
| 226 return; | 232 return; |
| 227 | 233 |
| 228 // This action changes the selection so we do not reuse existing tabs. | 234 // This action changes the selection so we do not reuse existing tabs. |
| 229 OpenFileManagerWithInternalActionId(profile, url, "select"); | 235 OpenFileManagerWithInternalActionId(profile, url, "select"); |
| 230 } | 236 } |
| 231 | 237 |
| 232 } // namespace util | 238 } // namespace util |
| 233 } // namespace file_manager | 239 } // namespace file_manager |
| OLD | NEW |