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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 bool ParseTaskID(const std::string& task_id, TaskDescriptor* task) { | 222 bool ParseTaskID(const std::string& task_id, TaskDescriptor* task) { |
223 DCHECK(task); | 223 DCHECK(task); |
224 | 224 |
225 std::vector<std::string> result = base::SplitString( | 225 std::vector<std::string> result = base::SplitString( |
226 task_id, "|", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY); | 226 task_id, "|", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY); |
227 | 227 |
228 // Parse a legacy task ID that only contain two parts. Drive tasks are | 228 // Parse a legacy task ID that only contain two parts. Drive tasks are |
229 // identified by a prefix "drive-app:" on the extension ID. The legacy task | 229 // identified by a prefix "drive-app:" on the extension ID. The legacy task |
230 // IDs can be stored in preferences. | 230 // IDs can be stored in preferences. |
231 if (result.size() == 2) { | 231 if (result.size() == 2) { |
232 if (base::StartsWithASCII(result[0], kDriveTaskExtensionPrefix, true)) { | 232 if (base::StartsWith(result[0], kDriveTaskExtensionPrefix, |
| 233 base::CompareCase::SENSITIVE)) { |
233 task->task_type = TASK_TYPE_DRIVE_APP; | 234 task->task_type = TASK_TYPE_DRIVE_APP; |
234 task->app_id = result[0].substr(kDriveTaskExtensionPrefixLength); | 235 task->app_id = result[0].substr(kDriveTaskExtensionPrefixLength); |
235 } else { | 236 } else { |
236 task->task_type = TASK_TYPE_FILE_BROWSER_HANDLER; | 237 task->task_type = TASK_TYPE_FILE_BROWSER_HANDLER; |
237 task->app_id = result[0]; | 238 task->app_id = result[0]; |
238 } | 239 } |
239 | 240 |
240 task->action_id = result[1]; | 241 task->action_id = result[1]; |
241 | 242 |
242 return true; | 243 return true; |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 DCHECK(!task->is_default()); | 565 DCHECK(!task->is_default()); |
565 if (IsFallbackFileHandler(task->task_descriptor())) { | 566 if (IsFallbackFileHandler(task->task_descriptor())) { |
566 task->set_is_default(true); | 567 task->set_is_default(true); |
567 return; | 568 return; |
568 } | 569 } |
569 } | 570 } |
570 } | 571 } |
571 | 572 |
572 } // namespace file_tasks | 573 } // namespace file_tasks |
573 } // namespace file_manager | 574 } // namespace file_manager |
OLD | NEW |