| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| 11 #include "base/json/json_string_value_serializer.h" | 11 #include "base/json/json_string_value_serializer.h" |
| 12 #include "base/metrics/histogram_macros.h" | 12 #include "base/metrics/histogram_macros.h" |
| 13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
| 14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 15 #include "base/trace_event/trace_event.h" | 15 #include "base/trace_event/trace_event.h" |
| 16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 17 #include "chrome/browser/extensions/component_extensions_whitelist/whitelist.h" | 17 #include "chrome/browser/extensions/component_extensions_whitelist/whitelist.h" |
| 18 #include "chrome/browser/extensions/data_deleter.h" | 18 #include "chrome/browser/extensions/data_deleter.h" |
| 19 #include "chrome/browser/extensions/extension_service.h" | 19 #include "chrome/browser/extensions/extension_service.h" |
| 20 #include "chrome/browser/pdf/pdf_extension_util.h" | 20 #include "chrome/browser/pdf/pdf_extension_util.h" |
| 21 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
| 22 #include "chrome/browser/search/hotword_service.h" | 22 #include "chrome/browser/search/hotword_service.h" |
| 23 #include "chrome/browser/search/hotword_service_factory.h" | 23 #include "chrome/browser/search/hotword_service_factory.h" |
| 24 #include "chrome/browser/ui/webui/md_bookmarks_ui.h" |
| 24 #include "chrome/common/channel_info.h" | 25 #include "chrome/common/channel_info.h" |
| 26 #include "chrome/common/chrome_features.h" |
| 25 #include "chrome/common/chrome_paths.h" | 27 #include "chrome/common/chrome_paths.h" |
| 26 #include "chrome/common/chrome_switches.h" | 28 #include "chrome/common/chrome_switches.h" |
| 27 #include "chrome/common/extensions/extension_constants.h" | 29 #include "chrome/common/extensions/extension_constants.h" |
| 28 #include "chrome/common/features.h" | 30 #include "chrome/common/features.h" |
| 29 #include "chrome/grit/browser_resources.h" | 31 #include "chrome/grit/browser_resources.h" |
| 30 #include "chrome/grit/chromium_strings.h" | 32 #include "chrome/grit/chromium_strings.h" |
| 31 #include "chrome/grit/generated_resources.h" | 33 #include "chrome/grit/generated_resources.h" |
| 32 #include "components/crx_file/id_util.h" | 34 #include "components/crx_file/id_util.h" |
| 33 #include "components/version_info/version_info.h" | 35 #include "components/version_info/version_info.h" |
| 34 #include "content/public/browser/browser_thread.h" | 36 #include "content/public/browser/browser_thread.h" |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 if (browser_defaults::enable_help_app) { | 466 if (browser_defaults::enable_help_app) { |
| 465 Add(IDR_HELP_MANIFEST, base::FilePath(FILE_PATH_LITERAL( | 467 Add(IDR_HELP_MANIFEST, base::FilePath(FILE_PATH_LITERAL( |
| 466 "/usr/share/chromeos-assets/helpapp"))); | 468 "/usr/share/chromeos-assets/helpapp"))); |
| 467 } | 469 } |
| 468 #endif // defined(GOOGLE_CHROME_BUILD) | 470 #endif // defined(GOOGLE_CHROME_BUILD) |
| 469 | 471 |
| 470 // Skip all other extensions that require user session presence. | 472 // Skip all other extensions that require user session presence. |
| 471 if (!skip_session_components) { | 473 if (!skip_session_components) { |
| 472 const base::CommandLine* command_line = | 474 const base::CommandLine* command_line = |
| 473 base::CommandLine::ForCurrentProcess(); | 475 base::CommandLine::ForCurrentProcess(); |
| 474 if (!command_line->HasSwitch(chromeos::switches::kGuestSession)) | 476 if (!command_line->HasSwitch(chromeos::switches::kGuestSession) && |
| 477 !MdBookmarkUI::IsEnabled()) { |
| 475 Add(IDR_BOOKMARKS_MANIFEST, | 478 Add(IDR_BOOKMARKS_MANIFEST, |
| 476 base::FilePath(FILE_PATH_LITERAL("bookmark_manager"))); | 479 base::FilePath(FILE_PATH_LITERAL("bookmark_manager"))); |
| 480 } |
| 477 | 481 |
| 478 Add(IDR_CROSH_BUILTIN_MANIFEST, base::FilePath(FILE_PATH_LITERAL( | 482 Add(IDR_CROSH_BUILTIN_MANIFEST, base::FilePath(FILE_PATH_LITERAL( |
| 479 "/usr/share/chromeos-assets/crosh_builtin"))); | 483 "/usr/share/chromeos-assets/crosh_builtin"))); |
| 480 } | 484 } |
| 481 #else // defined(OS_CHROMEOS) | 485 #else // defined(OS_CHROMEOS) |
| 482 DCHECK(!skip_session_components); | 486 DCHECK(!skip_session_components); |
| 483 Add(IDR_BOOKMARKS_MANIFEST, | 487 if (!MdBookmarkUI::IsEnabled()) { |
| 484 base::FilePath(FILE_PATH_LITERAL("bookmark_manager"))); | 488 Add(IDR_BOOKMARKS_MANIFEST, |
| 489 base::FilePath(FILE_PATH_LITERAL("bookmark_manager"))); |
| 490 } |
| 485 #if defined(ENABLE_PRINTING) | 491 #if defined(ENABLE_PRINTING) |
| 486 // Cloud Print component app. Not required on Chrome OS. | 492 // Cloud Print component app. Not required on Chrome OS. |
| 487 Add(IDR_CLOUDPRINT_MANIFEST, | 493 Add(IDR_CLOUDPRINT_MANIFEST, |
| 488 base::FilePath(FILE_PATH_LITERAL("cloud_print"))); | 494 base::FilePath(FILE_PATH_LITERAL("cloud_print"))); |
| 489 #endif // defined(ENABLE_PRINTING) | 495 #endif // defined(ENABLE_PRINTING) |
| 490 #endif // defined(OS_CHROMEOS) | 496 #endif // defined(OS_CHROMEOS) |
| 491 | 497 |
| 492 if (!skip_session_components) { | 498 if (!skip_session_components) { |
| 493 AddWebStoreApp(); | 499 AddWebStoreApp(); |
| 494 AddChromeApp(); | 500 AddChromeApp(); |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 manifest.release(), | 696 manifest.release(), |
| 691 root_directory, | 697 root_directory, |
| 692 false); | 698 false); |
| 693 CHECK_EQ(extension_id, actual_extension_id); | 699 CHECK_EQ(extension_id, actual_extension_id); |
| 694 if (!done_cb.is_null()) | 700 if (!done_cb.is_null()) |
| 695 done_cb.Run(); | 701 done_cb.Run(); |
| 696 } | 702 } |
| 697 #endif | 703 #endif |
| 698 | 704 |
| 699 } // namespace extensions | 705 } // namespace extensions |
| OLD | NEW |