| 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/file_tasks.h" | 5 #include "chrome/browser/chromeos/file_manager/file_tasks.h" |
| 6 | 6 |
| 7 #include "apps/launcher.h" | 7 #include "apps/launcher.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "chrome/browser/extensions/extension_util.h" | 22 #include "chrome/browser/extensions/extension_util.h" |
| 23 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
| 24 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 24 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
| 25 #include "chrome/common/extensions/api/file_browser_handlers/file_browser_handle
r.h" | 25 #include "chrome/common/extensions/api/file_browser_handlers/file_browser_handle
r.h" |
| 26 #include "chrome/common/extensions/api/file_browser_private.h" | 26 #include "chrome/common/extensions/api/file_browser_private.h" |
| 27 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
| 28 #include "chromeos/chromeos_switches.h" | 28 #include "chromeos/chromeos_switches.h" |
| 29 #include "extensions/browser/extension_host.h" | 29 #include "extensions/browser/extension_host.h" |
| 30 #include "extensions/browser/extension_registry.h" | 30 #include "extensions/browser/extension_registry.h" |
| 31 #include "extensions/browser/extension_system.h" | 31 #include "extensions/browser/extension_system.h" |
| 32 #include "extensions/browser/extension_util.h" |
| 32 #include "extensions/common/constants.h" | 33 #include "extensions/common/constants.h" |
| 33 #include "extensions/common/extension_set.h" | 34 #include "extensions/common/extension_set.h" |
| 34 #include "google_apis/drive/gdata_wapi_parser.h" | 35 #include "google_apis/drive/gdata_wapi_parser.h" |
| 35 #include "webkit/browser/fileapi/file_system_context.h" | 36 #include "webkit/browser/fileapi/file_system_context.h" |
| 36 #include "webkit/browser/fileapi/file_system_url.h" | 37 #include "webkit/browser/fileapi/file_system_url.h" |
| 37 | 38 |
| 38 using extensions::Extension; | 39 using extensions::Extension; |
| 39 using extensions::app_file_handler_util::FindFileHandlersForFiles; | 40 using extensions::app_file_handler_util::FindFileHandlersForFiles; |
| 40 using fileapi::FileSystemURL; | 41 using fileapi::FileSystemURL; |
| 41 | 42 |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 for (extensions::ExtensionSet::const_iterator iter = | 378 for (extensions::ExtensionSet::const_iterator iter = |
| 378 enabled_extensions.begin(); | 379 enabled_extensions.begin(); |
| 379 iter != enabled_extensions.end(); | 380 iter != enabled_extensions.end(); |
| 380 ++iter) { | 381 ++iter) { |
| 381 const Extension* extension = iter->get(); | 382 const Extension* extension = iter->get(); |
| 382 | 383 |
| 383 // We don't support using hosted apps to open files. | 384 // We don't support using hosted apps to open files. |
| 384 if (!extension->is_platform_app()) | 385 if (!extension->is_platform_app()) |
| 385 continue; | 386 continue; |
| 386 | 387 |
| 388 // Ephemeral apps cannot be file handlers. |
| 389 if (extensions::util::IsEphemeralApp(extension->id(), profile)) |
| 390 continue; |
| 391 |
| 387 if (profile->IsOffTheRecord() && | 392 if (profile->IsOffTheRecord() && |
| 388 !extensions::util::IsIncognitoEnabled(extension->id(), profile)) | 393 !extensions::util::IsIncognitoEnabled(extension->id(), profile)) |
| 389 continue; | 394 continue; |
| 390 | 395 |
| 391 typedef std::vector<const extensions::FileHandlerInfo*> FileHandlerList; | 396 typedef std::vector<const extensions::FileHandlerInfo*> FileHandlerList; |
| 392 FileHandlerList file_handlers = | 397 FileHandlerList file_handlers = |
| 393 FindFileHandlersForFiles(*extension, path_mime_set); | 398 FindFileHandlersForFiles(*extension, path_mime_set); |
| 394 if (file_handlers.empty()) | 399 if (file_handlers.empty()) |
| 395 continue; | 400 continue; |
| 396 | 401 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 if (file_browser_handlers::IsFallbackFileBrowserHandler( | 528 if (file_browser_handlers::IsFallbackFileBrowserHandler( |
| 524 task->task_descriptor())) { | 529 task->task_descriptor())) { |
| 525 task->set_is_default(true); | 530 task->set_is_default(true); |
| 526 return; | 531 return; |
| 527 } | 532 } |
| 528 } | 533 } |
| 529 } | 534 } |
| 530 | 535 |
| 531 } // namespace file_tasks | 536 } // namespace file_tasks |
| 532 } // namespace file_manager | 537 } // namespace file_manager |
| OLD | NEW |