| 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" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 // TODO(satorux): We should rename them to "file_browser_handler" and | 44 // TODO(satorux): We should rename them to "file_browser_handler" and |
| 45 // "file_handler" respectively when switching from preferences to | 45 // "file_handler" respectively when switching from preferences to |
| 46 // chrome.storage crbug.com/267359 | 46 // chrome.storage crbug.com/267359 |
| 47 const char kFileBrowserHandlerTaskType[] = "file"; | 47 const char kFileBrowserHandlerTaskType[] = "file"; |
| 48 const char kFileHandlerTaskType[] = "app"; | 48 const char kFileHandlerTaskType[] = "app"; |
| 49 const char kDriveAppTaskType[] = "drive"; | 49 const char kDriveAppTaskType[] = "drive"; |
| 50 | 50 |
| 51 // Drive apps always use the action ID. | 51 // Drive apps always use the action ID. |
| 52 const char kDriveAppActionID[] = "open-with"; | 52 const char kDriveAppActionID[] = "open-with"; |
| 53 | 53 |
| 54 // Default icon path for drive docs. | |
| 55 const char kDefaultIcon[] = "images/filetype_generic.png"; | |
| 56 | |
| 57 // Converts a TaskType to a string. | 54 // Converts a TaskType to a string. |
| 58 std::string TaskTypeToString(TaskType task_type) { | 55 std::string TaskTypeToString(TaskType task_type) { |
| 59 switch (task_type) { | 56 switch (task_type) { |
| 60 case TASK_TYPE_FILE_BROWSER_HANDLER: | 57 case TASK_TYPE_FILE_BROWSER_HANDLER: |
| 61 return kFileBrowserHandlerTaskType; | 58 return kFileBrowserHandlerTaskType; |
| 62 case TASK_TYPE_FILE_HANDLER: | 59 case TASK_TYPE_FILE_HANDLER: |
| 63 return kFileHandlerTaskType; | 60 return kFileHandlerTaskType; |
| 64 case TASK_TYPE_DRIVE_APP: | 61 case TASK_TYPE_DRIVE_APP: |
| 65 return kDriveAppTaskType; | 62 return kDriveAppTaskType; |
| 66 case TASK_TYPE_UNKNOWN: | 63 case TASK_TYPE_UNKNOWN: |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 if (file_browser_handlers::IsFallbackFileBrowserHandler( | 528 if (file_browser_handlers::IsFallbackFileBrowserHandler( |
| 532 task->task_descriptor())) { | 529 task->task_descriptor())) { |
| 533 task->set_is_default(true); | 530 task->set_is_default(true); |
| 534 return; | 531 return; |
| 535 } | 532 } |
| 536 } | 533 } |
| 537 } | 534 } |
| 538 | 535 |
| 539 } // namespace file_tasks | 536 } // namespace file_tasks |
| 540 } // namespace file_manager | 537 } // namespace file_manager |
| OLD | NEW |