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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/json/json_string_value_serializer.h" | 9 #include "base/json/json_string_value_serializer.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "extensions/common/id_util.h" | 27 #include "extensions/common/id_util.h" |
28 #include "grit/browser_resources.h" | 28 #include "grit/browser_resources.h" |
29 #include "ui/base/resource/resource_bundle.h" | 29 #include "ui/base/resource/resource_bundle.h" |
30 | 30 |
31 #if defined(OFFICIAL_BUILD) | 31 #if defined(OFFICIAL_BUILD) |
32 #include "chrome/browser/defaults.h" | 32 #include "chrome/browser/defaults.h" |
33 #endif | 33 #endif |
34 | 34 |
35 #if defined(OS_CHROMEOS) | 35 #if defined(OS_CHROMEOS) |
36 #include "chrome/browser/chromeos/login/user_manager.h" | 36 #include "chrome/browser/chromeos/login/user_manager.h" |
| 37 #include "chromeos/chromeos_switches.h" |
37 #endif | 38 #endif |
38 | 39 |
39 #if defined(ENABLE_APP_LIST) | 40 #if defined(ENABLE_APP_LIST) |
40 #include "grit/chromium_strings.h" | 41 #include "grit/chromium_strings.h" |
41 #include "ui/base/l10n/l10n_util.h" | 42 #include "ui/base/l10n/l10n_util.h" |
42 #endif | 43 #endif |
43 | 44 |
44 namespace extensions { | 45 namespace extensions { |
45 | 46 |
46 namespace { | 47 namespace { |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 #if defined(OFFICIAL_BUILD) | 349 #if defined(OFFICIAL_BUILD) |
349 if (browser_defaults::enable_help_app) { | 350 if (browser_defaults::enable_help_app) { |
350 Add(IDR_HELP_MANIFEST, base::FilePath(FILE_PATH_LITERAL( | 351 Add(IDR_HELP_MANIFEST, base::FilePath(FILE_PATH_LITERAL( |
351 "/usr/share/chromeos-assets/helpapp"))); | 352 "/usr/share/chromeos-assets/helpapp"))); |
352 } | 353 } |
353 #endif | 354 #endif |
354 | 355 |
355 // Skip all other extensions that require user session presence. | 356 // Skip all other extensions that require user session presence. |
356 if (!skip_session_components) { | 357 if (!skip_session_components) { |
357 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 358 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
358 if (!command_line->HasSwitch(switches::kGuestSession)) | 359 if (!command_line->HasSwitch(chromeos::switches::kGuestSession)) |
359 Add(IDR_BOOKMARKS_MANIFEST, | 360 Add(IDR_BOOKMARKS_MANIFEST, |
360 base::FilePath(FILE_PATH_LITERAL("bookmark_manager"))); | 361 base::FilePath(FILE_PATH_LITERAL("bookmark_manager"))); |
361 | 362 |
362 Add(IDR_CROSH_BUILTIN_MANIFEST, base::FilePath(FILE_PATH_LITERAL( | 363 Add(IDR_CROSH_BUILTIN_MANIFEST, base::FilePath(FILE_PATH_LITERAL( |
363 "/usr/share/chromeos-assets/crosh_builtin"))); | 364 "/usr/share/chromeos-assets/crosh_builtin"))); |
364 } | 365 } |
365 #else // !defined(OS_CHROMEOS) | 366 #else // !defined(OS_CHROMEOS) |
366 DCHECK(!skip_session_components); | 367 DCHECK(!skip_session_components); |
367 Add(IDR_BOOKMARKS_MANIFEST, | 368 Add(IDR_BOOKMARKS_MANIFEST, |
368 base::FilePath(FILE_PATH_LITERAL("bookmark_manager"))); | 369 base::FilePath(FILE_PATH_LITERAL("bookmark_manager"))); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 | 417 |
417 #if defined(OS_CHROMEOS) | 418 #if defined(OS_CHROMEOS) |
418 if (!skip_session_components) { | 419 if (!skip_session_components) { |
419 Add(IDR_WALLPAPERMANAGER_MANIFEST, | 420 Add(IDR_WALLPAPERMANAGER_MANIFEST, |
420 base::FilePath(FILE_PATH_LITERAL("chromeos/wallpaper_manager"))); | 421 base::FilePath(FILE_PATH_LITERAL("chromeos/wallpaper_manager"))); |
421 | 422 |
422 if (browser_defaults::enable_component_quick_office) { | 423 if (browser_defaults::enable_component_quick_office) { |
423 // Don't load Quickoffice component extension in Guest mode because | 424 // Don't load Quickoffice component extension in Guest mode because |
424 // it doesn't work in Incognito mode due to disabled temp fs. | 425 // it doesn't work in Incognito mode due to disabled temp fs. |
425 // TODO(dpolukhin): enable Quickoffice in Guest mode. | 426 // TODO(dpolukhin): enable Quickoffice in Guest mode. |
426 if (!command_line->HasSwitch(switches::kGuestSession)) { | 427 if (!command_line->HasSwitch(chromeos::switches::kGuestSession)) { |
427 Add(IDR_QUICK_OFFICE_MANIFEST, base::FilePath(FILE_PATH_LITERAL( | 428 Add(IDR_QUICK_OFFICE_MANIFEST, base::FilePath(FILE_PATH_LITERAL( |
428 "/usr/share/chromeos-assets/quick_office"))); | 429 "/usr/share/chromeos-assets/quick_office"))); |
429 } | 430 } |
430 } | 431 } |
431 | 432 |
432 base::FilePath echo_extension_path(FILE_PATH_LITERAL( | 433 base::FilePath echo_extension_path(FILE_PATH_LITERAL( |
433 "/usr/share/chromeos-assets/echo")); | 434 "/usr/share/chromeos-assets/echo")); |
434 if (command_line->HasSwitch(switches::kEchoExtensionPath)) { | 435 if (command_line->HasSwitch(switches::kEchoExtensionPath)) { |
435 echo_extension_path = | 436 echo_extension_path = |
436 command_line->GetSwitchValuePath(switches::kEchoExtensionPath); | 437 command_line->GetSwitchValuePath(switches::kEchoExtensionPath); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 void ComponentLoader::RegisterUserPrefs(PrefRegistrySyncable* registry) { | 472 void ComponentLoader::RegisterUserPrefs(PrefRegistrySyncable* registry) { |
472 registry->RegisterStringPref(prefs::kEnterpriseWebStoreURL, | 473 registry->RegisterStringPref(prefs::kEnterpriseWebStoreURL, |
473 std::string() /* default_value */, | 474 std::string() /* default_value */, |
474 PrefRegistrySyncable::UNSYNCABLE_PREF); | 475 PrefRegistrySyncable::UNSYNCABLE_PREF); |
475 registry->RegisterStringPref(prefs::kEnterpriseWebStoreName, | 476 registry->RegisterStringPref(prefs::kEnterpriseWebStoreName, |
476 std::string() /* default_value */, | 477 std::string() /* default_value */, |
477 PrefRegistrySyncable::UNSYNCABLE_PREF); | 478 PrefRegistrySyncable::UNSYNCABLE_PREF); |
478 } | 479 } |
479 | 480 |
480 } // namespace extensions | 481 } // namespace extensions |
OLD | NEW |