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