Chromium Code Reviews| 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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 366 } | 366 } |
| 367 if (browser_defaults::enable_help_app) { | 367 if (browser_defaults::enable_help_app) { |
| 368 Add(IDR_HELP_MANIFEST, base::FilePath(FILE_PATH_LITERAL( | 368 Add(IDR_HELP_MANIFEST, base::FilePath(FILE_PATH_LITERAL( |
| 369 "/usr/share/chromeos-assets/helpapp"))); | 369 "/usr/share/chromeos-assets/helpapp"))); |
| 370 } | 370 } |
| 371 #endif | 371 #endif |
| 372 | 372 |
| 373 // Skip all other extensions that require user session presence. | 373 // Skip all other extensions that require user session presence. |
| 374 if (!skip_session_components) { | 374 if (!skip_session_components) { |
| 375 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 375 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 376 if (!command_line->HasSwitch(chromeos::switches::kGuestSession)) | 376 if (!command_line->HasSwitch(chromeos::switches::kGuestSession)) { |
| 377 Add(IDR_BOOKMARKS_MANIFEST, | 377 Add(IDR_BOOKMARKS_MANIFEST, |
| 378 base::FilePath(FILE_PATH_LITERAL("bookmark_manager"))); | 378 base::FilePath(FILE_PATH_LITERAL("bookmark_manager"))); |
| 379 if (CommandLine::ForCurrentProcess()->HasSwitch( | |
| 380 switches::kEnableEnhancedBookmarks)) { | |
| 381 Add(IDR_ENHANCED_BOOKMARKS_MANIFEST, | |
| 382 base::FilePath(FILE_PATH_LITERAL("enhanced_bookmark_manager"))); | |
| 383 } | |
| 384 } | |
| 379 | 385 |
| 380 Add(IDR_CROSH_BUILTIN_MANIFEST, base::FilePath(FILE_PATH_LITERAL( | 386 Add(IDR_CROSH_BUILTIN_MANIFEST, base::FilePath(FILE_PATH_LITERAL( |
| 381 "/usr/share/chromeos-assets/crosh_builtin"))); | 387 "/usr/share/chromeos-assets/crosh_builtin"))); |
| 382 } | 388 } |
| 383 #else // !defined(OS_CHROMEOS) | 389 #else // !defined(OS_CHROMEOS) |
| 384 DCHECK(!skip_session_components); | 390 DCHECK(!skip_session_components); |
| 385 Add(IDR_BOOKMARKS_MANIFEST, | 391 Add(IDR_BOOKMARKS_MANIFEST, |
| 386 base::FilePath(FILE_PATH_LITERAL("bookmark_manager"))); | 392 base::FilePath(FILE_PATH_LITERAL("bookmark_manager"))); |
| 393 if (CommandLine::ForCurrentProcess()->HasSwitch( | |
| 394 switches::kEnableEnhancedBookmarks)) { | |
| 395 Add(IDR_ENHANCED_BOOKMARKS_MANIFEST, | |
| 396 base::FilePath(FILE_PATH_LITERAL("enhanced_bookmark_manager"))); | |
| 397 } | |
|
not at google - send to devlin
2013/10/01 00:21:01
you could move both the normal and the enhanced ex
Mike Wittman
2013/10/01 17:56:06
Done.
| |
| 387 // Cloud Print component app. Not required on Chrome OS. | 398 // Cloud Print component app. Not required on Chrome OS. |
| 388 Add(IDR_CLOUDPRINT_MANIFEST, | 399 Add(IDR_CLOUDPRINT_MANIFEST, |
| 389 base::FilePath(FILE_PATH_LITERAL("cloud_print"))); | 400 base::FilePath(FILE_PATH_LITERAL("cloud_print"))); |
| 390 #endif | 401 #endif |
| 391 | 402 |
| 392 if (!skip_session_components) { | 403 if (!skip_session_components) { |
| 393 AddWebStoreApp(); | 404 AddWebStoreApp(); |
| 394 AddChromeApp(); | 405 AddChromeApp(); |
| 395 } | 406 } |
| 396 | 407 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 507 | 518 |
| 508 void ComponentLoader::UnloadComponent(ComponentExtensionInfo* component) { | 519 void ComponentLoader::UnloadComponent(ComponentExtensionInfo* component) { |
| 509 delete component->manifest; | 520 delete component->manifest; |
| 510 if (extension_service_->is_ready()) { | 521 if (extension_service_->is_ready()) { |
| 511 extension_service_-> | 522 extension_service_-> |
| 512 RemoveComponentExtension(component->extension_id); | 523 RemoveComponentExtension(component->extension_id); |
| 513 } | 524 } |
| 514 } | 525 } |
| 515 | 526 |
| 516 } // namespace extensions | 527 } // namespace extensions |
| OLD | NEW |