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

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

Issue 635573005: Cleanup: Better constify some strings in chrome/browser/{chromeos,extensions}. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, nit Created 6 years, 1 month 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 tasks->swap(filtered); 104 tasks->swap(filtered);
105 } 105 }
106 106
107 // Returns true if the given task is a handler by built-in apps like Files.app 107 // Returns true if the given task is a handler by built-in apps like Files.app
108 // itself or QuickOffice etc. They are used as the initial default app. 108 // itself or QuickOffice etc. They are used as the initial default app.
109 bool IsFallbackFileHandler(const file_tasks::TaskDescriptor& task) { 109 bool IsFallbackFileHandler(const file_tasks::TaskDescriptor& task) {
110 if (task.task_type != file_tasks::TASK_TYPE_FILE_BROWSER_HANDLER && 110 if (task.task_type != file_tasks::TASK_TYPE_FILE_BROWSER_HANDLER &&
111 task.task_type != file_tasks::TASK_TYPE_FILE_HANDLER) 111 task.task_type != file_tasks::TASK_TYPE_FILE_HANDLER)
112 return false; 112 return false;
113 113
114 const char* kBuiltInApps[] = { 114 const char* const kBuiltInApps[] = {
115 kFileManagerAppId, 115 kFileManagerAppId,
116 kVideoPlayerAppId, 116 kVideoPlayerAppId,
117 kGalleryAppId, 117 kGalleryAppId,
118 extension_misc::kQuickOfficeComponentExtensionId, 118 extension_misc::kQuickOfficeComponentExtensionId,
119 extension_misc::kQuickOfficeInternalExtensionId, 119 extension_misc::kQuickOfficeInternalExtensionId,
120 extension_misc::kQuickOfficeExtensionId, 120 extension_misc::kQuickOfficeExtensionId,
121 }; 121 };
122 122
123 for (size_t i = 0; i < arraysize(kBuiltInApps); ++i) { 123 for (size_t i = 0; i < arraysize(kBuiltInApps); ++i) {
124 if (task.app_id == kBuiltInApps[i]) 124 if (task.app_id == kBuiltInApps[i])
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 DCHECK(!task->is_default()); 518 DCHECK(!task->is_default());
519 if (IsFallbackFileHandler(task->task_descriptor())) { 519 if (IsFallbackFileHandler(task->task_descriptor())) {
520 task->set_is_default(true); 520 task->set_is_default(true);
521 return; 521 return;
522 } 522 }
523 } 523 }
524 } 524 }
525 525
526 } // namespace file_tasks 526 } // namespace file_tasks
527 } // namespace file_manager 527 } // namespace file_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698