Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: chrome/browser/chromeos/file_manager/file_tasks.cc

Issue 1172183002: Move StartsWith[ASCII] to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string_util3
Patch Set: merger Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 bool ParseTaskID(const std::string& task_id, TaskDescriptor* task) { 221 bool ParseTaskID(const std::string& task_id, TaskDescriptor* task) {
222 DCHECK(task); 222 DCHECK(task);
223 223
224 std::vector<std::string> result; 224 std::vector<std::string> result;
225 int count = Tokenize(task_id, std::string("|"), &result); 225 int count = Tokenize(task_id, std::string("|"), &result);
226 226
227 // Parse a legacy task ID that only contain two parts. Drive tasks are 227 // Parse a legacy task ID that only contain two parts. Drive tasks are
228 // identified by a prefix "drive-app:" on the extension ID. The legacy task 228 // identified by a prefix "drive-app:" on the extension ID. The legacy task
229 // IDs can be stored in preferences. 229 // IDs can be stored in preferences.
230 if (count == 2) { 230 if (count == 2) {
231 if (StartsWithASCII(result[0], kDriveTaskExtensionPrefix, true)) { 231 if (base::StartsWithASCII(result[0], kDriveTaskExtensionPrefix, true)) {
232 task->task_type = TASK_TYPE_DRIVE_APP; 232 task->task_type = TASK_TYPE_DRIVE_APP;
233 task->app_id = result[0].substr(kDriveTaskExtensionPrefixLength); 233 task->app_id = result[0].substr(kDriveTaskExtensionPrefixLength);
234 } else { 234 } else {
235 task->task_type = TASK_TYPE_FILE_BROWSER_HANDLER; 235 task->task_type = TASK_TYPE_FILE_BROWSER_HANDLER;
236 task->app_id = result[0]; 236 task->app_id = result[0];
237 } 237 }
238 238
239 task->action_id = result[1]; 239 task->action_id = result[1];
240 240
241 return true; 241 return true;
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 DCHECK(!task->is_default()); 563 DCHECK(!task->is_default());
564 if (IsFallbackFileHandler(task->task_descriptor())) { 564 if (IsFallbackFileHandler(task->task_descriptor())) {
565 task->set_is_default(true); 565 task->set_is_default(true);
566 return; 566 return;
567 } 567 }
568 } 568 }
569 } 569 }
570 570
571 } // namespace file_tasks 571 } // namespace file_tasks
572 } // namespace file_manager 572 } // namespace file_manager
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/drive/file_system_util.cc ('k') | chrome/browser/chromeos/input_method/input_method_engine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698