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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 | 348 |
349 void ComponentLoader::AddDefaultComponentExtensions( | 349 void ComponentLoader::AddDefaultComponentExtensions( |
350 bool skip_session_components) { | 350 bool skip_session_components) { |
351 // Do not add component extensions that have background pages here -- add them | 351 // Do not add component extensions that have background pages here -- add them |
352 // to AddDefaultComponentExtensionsWithBackgroundPages. | 352 // to AddDefaultComponentExtensionsWithBackgroundPages. |
353 #if defined(OS_CHROMEOS) | 353 #if defined(OS_CHROMEOS) |
354 Add(IDR_MOBILE_MANIFEST, | 354 Add(IDR_MOBILE_MANIFEST, |
355 base::FilePath(FILE_PATH_LITERAL("/usr/share/chromeos-assets/mobile"))); | 355 base::FilePath(FILE_PATH_LITERAL("/usr/share/chromeos-assets/mobile"))); |
356 | 356 |
357 #if defined(GOOGLE_CHROME_BUILD) | 357 #if defined(GOOGLE_CHROME_BUILD) |
| 358 { |
| 359 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 360 if (!command_line->HasSwitch(chromeos::switches::kDisableGeniusApp)) { |
| 361 Add(IDR_GENIUS_APP_MANIFEST, base::FilePath(FILE_PATH_LITERAL( |
| 362 "/usr/share/chromeos-assets/genius_app"))); |
| 363 } |
| 364 } |
358 if (browser_defaults::enable_help_app) { | 365 if (browser_defaults::enable_help_app) { |
359 Add(IDR_HELP_MANIFEST, base::FilePath(FILE_PATH_LITERAL( | 366 Add(IDR_HELP_MANIFEST, base::FilePath(FILE_PATH_LITERAL( |
360 "/usr/share/chromeos-assets/helpapp"))); | 367 "/usr/share/chromeos-assets/helpapp"))); |
361 } | 368 } |
362 #endif | 369 #endif |
363 | 370 |
364 // Skip all other extensions that require user session presence. | 371 // Skip all other extensions that require user session presence. |
365 if (!skip_session_components) { | 372 if (!skip_session_components) { |
366 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 373 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
367 if (!command_line->HasSwitch(chromeos::switches::kGuestSession)) | 374 if (!command_line->HasSwitch(chromeos::switches::kGuestSession)) |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 | 505 |
499 void ComponentLoader::UnloadComponent(ComponentExtensionInfo* component) { | 506 void ComponentLoader::UnloadComponent(ComponentExtensionInfo* component) { |
500 delete component->manifest; | 507 delete component->manifest; |
501 if (extension_service_->is_ready()) { | 508 if (extension_service_->is_ready()) { |
502 extension_service_-> | 509 extension_service_-> |
503 RemoveComponentExtension(component->extension_id); | 510 RemoveComponentExtension(component->extension_id); |
504 } | 511 } |
505 } | 512 } |
506 | 513 |
507 } // namespace extensions | 514 } // namespace extensions |
OLD | NEW |