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/extensions/api/developer_private/developer_private_api.
h" | 5 #include "chrome/browser/extensions/api/developer_private/developer_private_api.
h" |
6 | 6 |
7 #include "apps/app_load_service.h" | 7 #include "apps/app_load_service.h" |
8 #include "apps/app_restore_service.h" | 8 #include "apps/app_restore_service.h" |
9 #include "apps/saved_files_service.h" | 9 #include "apps/saved_files_service.h" |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 file_util::ReplaceIllegalCharactersInPath(&name_sanitized, '_'); | 91 file_util::ReplaceIllegalCharactersInPath(&name_sanitized, '_'); |
92 return name == name_sanitized; | 92 return name == name_sanitized; |
93 } | 93 } |
94 | 94 |
95 const Extension* GetExtensionByPath(const ExtensionSet* extensions, | 95 const Extension* GetExtensionByPath(const ExtensionSet* extensions, |
96 const base::FilePath& path) { | 96 const base::FilePath& path) { |
97 base::FilePath extension_path = base::MakeAbsoluteFilePath(path); | 97 base::FilePath extension_path = base::MakeAbsoluteFilePath(path); |
98 for (ExtensionSet::const_iterator iter = extensions->begin(); | 98 for (ExtensionSet::const_iterator iter = extensions->begin(); |
99 iter != extensions->end(); ++iter) { | 99 iter != extensions->end(); ++iter) { |
100 if ((*iter)->path() == extension_path) | 100 if ((*iter)->path() == extension_path) |
101 return *iter; | 101 return iter->get(); |
102 } | 102 } |
103 return NULL; | 103 return NULL; |
104 } | 104 } |
105 | 105 |
106 } // namespace | 106 } // namespace |
107 | 107 |
108 namespace AllowFileAccess = api::developer_private::AllowFileAccess; | 108 namespace AllowFileAccess = api::developer_private::AllowFileAccess; |
109 namespace AllowIncognito = api::developer_private::AllowIncognito; | 109 namespace AllowIncognito = api::developer_private::AllowIncognito; |
110 namespace ChoosePath = api::developer_private::ChoosePath; | 110 namespace ChoosePath = api::developer_private::ChoosePath; |
111 namespace Enable = api::developer_private::Enable; | 111 namespace Enable = api::developer_private::Enable; |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 } | 376 } |
377 | 377 |
378 if (include_terminated) { | 378 if (include_terminated) { |
379 items.InsertAll(*service->terminated_extensions()); | 379 items.InsertAll(*service->terminated_extensions()); |
380 } | 380 } |
381 | 381 |
382 ItemInfoList item_list; | 382 ItemInfoList item_list; |
383 | 383 |
384 for (ExtensionSet::const_iterator iter = items.begin(); | 384 for (ExtensionSet::const_iterator iter = items.begin(); |
385 iter != items.end(); ++iter) { | 385 iter != items.end(); ++iter) { |
386 const Extension& item = **iter; | 386 const Extension& item = *iter->get(); |
387 | 387 |
388 // Don't show component extensions because they are only extensions as an | 388 // Don't show component extensions because they are only extensions as an |
389 // implementation detail of Chrome. | 389 // implementation detail of Chrome. |
390 if (item.location() == Manifest::COMPONENT && | 390 if (item.location() == Manifest::COMPONENT && |
391 !CommandLine::ForCurrentProcess()->HasSwitch( | 391 !CommandLine::ForCurrentProcess()->HasSwitch( |
392 switches::kShowComponentExtensionOptions)) { | 392 switches::kShowComponentExtensionOptions)) { |
393 continue; | 393 continue; |
394 } | 394 } |
395 | 395 |
396 // Don't show apps that aren't visible in either launcher or ntp. | 396 // Don't show apps that aren't visible in either launcher or ntp. |
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1138 | 1138 |
1139 #undef SET_STRING | 1139 #undef SET_STRING |
1140 return true; | 1140 return true; |
1141 } | 1141 } |
1142 | 1142 |
1143 DeveloperPrivateGetStringsFunction::~DeveloperPrivateGetStringsFunction() {} | 1143 DeveloperPrivateGetStringsFunction::~DeveloperPrivateGetStringsFunction() {} |
1144 | 1144 |
1145 } // namespace api | 1145 } // namespace api |
1146 | 1146 |
1147 } // namespace extensions | 1147 } // namespace extensions |
OLD | NEW |