| 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/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/prefs/scoped_user_pref_update.h" | 10 #include "base/prefs/scoped_user_pref_update.h" |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 enabled_extensions.begin(); | 398 enabled_extensions.begin(); |
| 399 iter != enabled_extensions.end(); | 399 iter != enabled_extensions.end(); |
| 400 ++iter) { | 400 ++iter) { |
| 401 const Extension* extension = iter->get(); | 401 const Extension* extension = iter->get(); |
| 402 | 402 |
| 403 // Check that the extension can be launched via an event. This includes all | 403 // Check that the extension can be launched via an event. This includes all |
| 404 // platform apps plus whitelisted extensions. | 404 // platform apps plus whitelisted extensions. |
| 405 if (!CanLaunchViaEvent(extension)) | 405 if (!CanLaunchViaEvent(extension)) |
| 406 continue; | 406 continue; |
| 407 | 407 |
| 408 // Ephemeral apps cannot be file handlers. | |
| 409 if (extensions::util::IsEphemeralApp(extension->id(), profile)) | |
| 410 continue; | |
| 411 | |
| 412 if (profile->IsOffTheRecord() && | 408 if (profile->IsOffTheRecord() && |
| 413 !extensions::util::IsIncognitoEnabled(extension->id(), profile)) | 409 !extensions::util::IsIncognitoEnabled(extension->id(), profile)) |
| 414 continue; | 410 continue; |
| 415 | 411 |
| 416 typedef std::vector<const extensions::FileHandlerInfo*> FileHandlerList; | 412 typedef std::vector<const extensions::FileHandlerInfo*> FileHandlerList; |
| 417 FileHandlerList file_handlers = | 413 FileHandlerList file_handlers = |
| 418 FindFileHandlersForFiles(*extension, path_mime_set); | 414 FindFileHandlersForFiles(*extension, path_mime_set); |
| 419 if (file_handlers.empty()) | 415 if (file_handlers.empty()) |
| 420 continue; | 416 continue; |
| 421 | 417 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 DCHECK(!task->is_default()); | 561 DCHECK(!task->is_default()); |
| 566 if (IsFallbackFileHandler(task->task_descriptor())) { | 562 if (IsFallbackFileHandler(task->task_descriptor())) { |
| 567 task->set_is_default(true); | 563 task->set_is_default(true); |
| 568 return; | 564 return; |
| 569 } | 565 } |
| 570 } | 566 } |
| 571 } | 567 } |
| 572 | 568 |
| 573 } // namespace file_tasks | 569 } // namespace file_tasks |
| 574 } // namespace file_manager | 570 } // namespace file_manager |
| OLD | NEW |