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/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
11 #include "chrome/browser/chromeos/drive/drive_app_registry.h" | 11 #include "chrome/browser/chromeos/drive/drive_app_registry.h" |
12 #include "chrome/browser/chromeos/drive/drive_integration_service.h" | |
13 #include "chrome/browser/chromeos/drive/file_system_util.h" | 12 #include "chrome/browser/chromeos/drive/file_system_util.h" |
14 #include "chrome/browser/chromeos/drive/file_task_executor.h" | 13 #include "chrome/browser/chromeos/drive/file_task_executor.h" |
15 #include "chrome/browser/chromeos/file_manager/file_browser_handlers.h" | 14 #include "chrome/browser/chromeos/file_manager/file_browser_handlers.h" |
16 #include "chrome/browser/chromeos/file_manager/fileapi_util.h" | 15 #include "chrome/browser/chromeos/file_manager/fileapi_util.h" |
17 #include "chrome/browser/chromeos/file_manager/open_util.h" | 16 #include "chrome/browser/chromeos/file_manager/open_util.h" |
18 #include "chrome/browser/chromeos/fileapi/file_system_backend.h" | 17 #include "chrome/browser/chromeos/fileapi/file_system_backend.h" |
19 #include "chrome/browser/extensions/extension_host.h" | 18 #include "chrome/browser/extensions/extension_host.h" |
20 #include "chrome/browser/extensions/extension_service.h" | 19 #include "chrome/browser/extensions/extension_service.h" |
21 #include "chrome/browser/extensions/extension_service.h" | 20 #include "chrome/browser/extensions/extension_service.h" |
22 #include "chrome/browser/extensions/extension_system.h" | 21 #include "chrome/browser/extensions/extension_system.h" |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 if (google_apis::ResourceEntry::ClassifyEntryKindByFileExtension( | 479 if (google_apis::ResourceEntry::ClassifyEntryKindByFileExtension( |
481 iter->first) & | 480 iter->first) & |
482 google_apis::ResourceEntry::KIND_OF_GOOGLE_DOCUMENT) { | 481 google_apis::ResourceEntry::KIND_OF_GOOGLE_DOCUMENT) { |
483 has_google_document = true; | 482 has_google_document = true; |
484 break; | 483 break; |
485 } | 484 } |
486 } | 485 } |
487 | 486 |
488 // Google document are not opened by drive apps but file manager. | 487 // Google document are not opened by drive apps but file manager. |
489 if (!has_google_document) { | 488 if (!has_google_document) { |
490 drive::DriveIntegrationService* integration_service = | 489 drive::DriveAppRegistry* app_registry = |
491 drive::DriveIntegrationServiceFactory::GetForProfile(profile); | 490 drive::util::GetDriveAppRegistryByProfile(profile); |
492 // |integration_service| is NULL if Drive is disabled. | 491 if (!app_registry) { |
493 if (!integration_service || !integration_service->drive_app_registry()) | 492 // |app_registry| is NULL if Drive is disabled. |
494 return; | 493 return; |
| 494 } |
495 | 495 |
496 FindDriveAppTasks(*integration_service->drive_app_registry(), | 496 FindDriveAppTasks(*app_registry, path_mime_set, result_list); |
497 path_mime_set, | |
498 result_list); | |
499 } | 497 } |
500 | 498 |
501 // Find and append file handler tasks. We know there aren't duplicates | 499 // Find and append file handler tasks. We know there aren't duplicates |
502 // because Drive apps and platform apps are entirely different kinds of | 500 // because Drive apps and platform apps are entirely different kinds of |
503 // tasks. | 501 // tasks. |
504 FindFileHandlerTasks(profile, | 502 FindFileHandlerTasks(profile, |
505 path_mime_set, | 503 path_mime_set, |
506 result_list); | 504 result_list); |
507 | 505 |
508 // Find and append file browser handler tasks. We know there aren't | 506 // Find and append file browser handler tasks. We know there aren't |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 if (file_browser_handlers::IsFallbackFileBrowserHandler( | 549 if (file_browser_handlers::IsFallbackFileBrowserHandler( |
552 task->task_descriptor())) { | 550 task->task_descriptor())) { |
553 task->set_is_default(true); | 551 task->set_is_default(true); |
554 return; | 552 return; |
555 } | 553 } |
556 } | 554 } |
557 } | 555 } |
558 | 556 |
559 } // namespace file_tasks | 557 } // namespace file_tasks |
560 } // namespace file_manager | 558 } // namespace file_manager |
OLD | NEW |