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/component_loader.h" | 5 #include "chrome/browser/extensions/component_loader.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
278 command_line->GetSwitchValuePath(switches::kFileManagerExtensionPath)); | 278 command_line->GetSwitchValuePath(switches::kFileManagerExtensionPath)); |
279 Add(IDR_FILEMANAGER_MANIFEST, filemgr_extension_path); | 279 Add(IDR_FILEMANAGER_MANIFEST, filemgr_extension_path); |
280 return; | 280 return; |
281 } | 281 } |
282 #endif // NDEBUG | 282 #endif // NDEBUG |
283 Add(IDR_FILEMANAGER_MANIFEST, | 283 Add(IDR_FILEMANAGER_MANIFEST, |
284 base::FilePath(FILE_PATH_LITERAL("file_manager"))); | 284 base::FilePath(FILE_PATH_LITERAL("file_manager"))); |
285 #endif // defined(FILE_MANAGER_EXTENSION) | 285 #endif // defined(FILE_MANAGER_EXTENSION) |
286 } | 286 } |
287 | 287 |
288 void ComponentLoader::AddHangoutServicesExtension() { | |
289 Add(IDR_HANGOUT_SERVICES_MANIFEST, | |
290 base::FilePath(FILE_PATH_LITERAL("hangout_services"))); | |
291 } | |
292 | |
288 void ComponentLoader::AddImageLoaderExtension() { | 293 void ComponentLoader::AddImageLoaderExtension() { |
289 #if defined(IMAGE_LOADER_EXTENSION) | 294 #if defined(IMAGE_LOADER_EXTENSION) |
290 #ifndef NDEBUG | 295 #ifndef NDEBUG |
291 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 296 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
292 if (command_line->HasSwitch(switches::kImageLoaderExtensionPath)) { | 297 if (command_line->HasSwitch(switches::kImageLoaderExtensionPath)) { |
293 base::FilePath image_loader_extension_path( | 298 base::FilePath image_loader_extension_path( |
294 command_line->GetSwitchValuePath(switches::kImageLoaderExtensionPath)); | 299 command_line->GetSwitchValuePath(switches::kImageLoaderExtensionPath)); |
295 Add(IDR_IMAGE_LOADER_MANIFEST, image_loader_extension_path); | 300 Add(IDR_IMAGE_LOADER_MANIFEST, image_loader_extension_path); |
296 return; | 301 return; |
297 } | 302 } |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
419 } | 424 } |
420 | 425 |
421 if (!skip_session_components) { | 426 if (!skip_session_components) { |
422 // Apps Debugger | 427 // Apps Debugger |
423 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAppsDevtool) && | 428 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAppsDevtool) && |
424 profile_prefs_->GetBoolean(prefs::kExtensionsUIDeveloperMode)) { | 429 profile_prefs_->GetBoolean(prefs::kExtensionsUIDeveloperMode)) { |
425 Add(IDR_APPS_DEBUGGER_MANIFEST, | 430 Add(IDR_APPS_DEBUGGER_MANIFEST, |
426 base::FilePath(FILE_PATH_LITERAL("apps_debugger"))); | 431 base::FilePath(FILE_PATH_LITERAL("apps_debugger"))); |
427 } | 432 } |
428 | 433 |
434 | |
429 AddFileManagerExtension(); | 435 AddFileManagerExtension(); |
436 AddHangoutServicesExtension(); | |
Yoyo Zhou
2013/10/23 23:24:27
Can this (and other such functions) be in an anony
Jói
2013/10/24 08:23:31
Without some larger changes, they need to be membe
| |
430 AddImageLoaderExtension(); | 437 AddImageLoaderExtension(); |
431 | 438 |
432 #if defined(ENABLE_SETTINGS_APP) | 439 #if defined(ENABLE_SETTINGS_APP) |
433 Add(IDR_SETTINGS_APP_MANIFEST, | 440 Add(IDR_SETTINGS_APP_MANIFEST, |
434 base::FilePath(FILE_PATH_LITERAL("settings_app"))); | 441 base::FilePath(FILE_PATH_LITERAL("settings_app"))); |
435 #endif | 442 #endif |
436 } | 443 } |
437 | 444 |
438 // If (!enable_background_extensions_during_testing || this isn't a test) | 445 // If (!enable_background_extensions_during_testing || this isn't a test) |
439 // install_feedback = false; | 446 // install_feedback = false; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
522 | 529 |
523 void ComponentLoader::UnloadComponent(ComponentExtensionInfo* component) { | 530 void ComponentLoader::UnloadComponent(ComponentExtensionInfo* component) { |
524 delete component->manifest; | 531 delete component->manifest; |
525 if (extension_service_->is_ready()) { | 532 if (extension_service_->is_ready()) { |
526 extension_service_-> | 533 extension_service_-> |
527 RemoveComponentExtension(component->extension_id); | 534 RemoveComponentExtension(component->extension_id); |
528 } | 535 } |
529 } | 536 } |
530 | 537 |
531 } // namespace extensions | 538 } // namespace extensions |
OLD | NEW |