| 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 #include "chrome/browser/extensions/file_manager_util.h" | 4 #include "chrome/browser/extensions/file_manager_util.h" |
| 5 | 5 |
| 6 #include "base/json/json_writer.h" | 6 #include "base/json/json_writer.h" |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "chrome/browser/chromeos/media/media_player.h" | 12 #include "chrome/browser/chromeos/media/media_player.h" |
| 13 #include "chrome/browser/platform_util.h" | |
| 14 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/simple_message_box.h" |
| 15 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
| 16 #include "chrome/browser/ui/browser_list.h" | 16 #include "chrome/browser/ui/browser_list.h" |
| 17 #include "content/browser/browser_thread.h" | 17 #include "content/browser/browser_thread.h" |
| 18 #include "content/browser/user_metrics.h" | 18 #include "content/browser/user_metrics.h" |
| 19 #include "grit/generated_resources.h" | 19 #include "grit/generated_resources.h" |
| 20 #include "net/base/escape.h" | 20 #include "net/base/escape.h" |
| 21 #include "ui/base/l10n/l10n_util.h" | 21 #include "ui/base/l10n/l10n_util.h" |
| 22 #include "webkit/fileapi/file_system_context.h" | 22 #include "webkit/fileapi/file_system_context.h" |
| 23 #include "webkit/fileapi/file_system_mount_point_provider.h" | 23 #include "webkit/fileapi/file_system_mount_point_provider.h" |
| 24 #include "webkit/fileapi/file_system_util.h" | 24 #include "webkit/fileapi/file_system_util.h" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 size_t extension_index = UMAExtensionIndex(ext.data(), | 211 size_t extension_index = UMAExtensionIndex(ext.data(), |
| 212 kUMATrackingExtensions, | 212 kUMATrackingExtensions, |
| 213 arraysize(kUMATrackingExtensions)); | 213 arraysize(kUMATrackingExtensions)); |
| 214 UMA_HISTOGRAM_ENUMERATION("FileBrowser.OpeningFileType", | 214 UMA_HISTOGRAM_ENUMERATION("FileBrowser.OpeningFileType", |
| 215 extension_index, | 215 extension_index, |
| 216 arraysize(kUMATrackingExtensions) - 1); | 216 arraysize(kUMATrackingExtensions) - 1); |
| 217 | 217 |
| 218 BrowserThread::PostTask( | 218 BrowserThread::PostTask( |
| 219 BrowserThread::UI, FROM_HERE, | 219 BrowserThread::UI, FROM_HERE, |
| 220 NewRunnableFunction( | 220 NewRunnableFunction( |
| 221 &platform_util::SimpleErrorBox, | 221 &browser::ShowErrorBox, |
| 222 static_cast<gfx::NativeWindow>(NULL), | 222 static_cast<gfx::NativeWindow>(NULL), |
| 223 l10n_util::GetStringUTF16(IDS_FILEBROWSER_ERROR_TITLE), | 223 l10n_util::GetStringUTF16(IDS_FILEBROWSER_ERROR_TITLE), |
| 224 l10n_util::GetStringFUTF16(IDS_FILEBROWSER_ERROR_UNKNOWN_FILE_TYPE, | 224 l10n_util::GetStringFUTF16(IDS_FILEBROWSER_ERROR_UNKNOWN_FILE_TYPE, |
| 225 UTF8ToUTF16(full_path.BaseName().value())) | 225 UTF8ToUTF16(full_path.BaseName().value())) |
| 226 )); | 226 )); |
| 227 } | 227 } |
| 228 | 228 |
| 229 // static | 229 // static |
| 230 std::string FileManagerUtil::GetArgumentsJson( | 230 std::string FileManagerUtil::GetArgumentsJson( |
| 231 SelectFileDialog::Type type, | 231 SelectFileDialog::Type type, |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 case SelectFileDialog::SELECT_OPEN_MULTI_FILE: | 297 case SelectFileDialog::SELECT_OPEN_MULTI_FILE: |
| 298 type_str = "open-multi-file"; | 298 type_str = "open-multi-file"; |
| 299 break; | 299 break; |
| 300 | 300 |
| 301 default: | 301 default: |
| 302 NOTREACHED(); | 302 NOTREACHED(); |
| 303 } | 303 } |
| 304 | 304 |
| 305 return type_str; | 305 return type_str; |
| 306 } | 306 } |
| OLD | NEW |