Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1090)

Side by Side Diff: chrome/browser/extensions/component_loader.cc

Issue 2805183002: Make ZIP archiver a component extension. (Closed)
Patch Set: Fix the code so that ZIP archiver is added only on Chrome OS. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/extensions/component_loader.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 base::FilePath(FILE_PATH_LITERAL("audio_player"))); 310 base::FilePath(FILE_PATH_LITERAL("audio_player")));
311 #endif // defined(OS_CHROMEOS) 311 #endif // defined(OS_CHROMEOS)
312 } 312 }
313 313
314 void ComponentLoader::AddGalleryExtension() { 314 void ComponentLoader::AddGalleryExtension() {
315 #if defined(OS_CHROMEOS) 315 #if defined(OS_CHROMEOS)
316 Add(IDR_GALLERY_MANIFEST, base::FilePath(FILE_PATH_LITERAL("gallery"))); 316 Add(IDR_GALLERY_MANIFEST, base::FilePath(FILE_PATH_LITERAL("gallery")));
317 #endif 317 #endif
318 } 318 }
319 319
320 void ComponentLoader::AddZipArchiverExtension() {
321 #if defined(OS_CHROMEOS)
322 Add(IDR_ZIP_ARCHIVER_MANIFEST,
323 base::FilePath(FILE_PATH_LITERAL("zip_archiver")));
324 #endif // defined(OS_CHROMEOS)
325 }
326
320 void ComponentLoader::AddWebstoreWidgetExtension() { 327 void ComponentLoader::AddWebstoreWidgetExtension() {
321 #if defined(OS_CHROMEOS) 328 #if defined(OS_CHROMEOS)
322 AddWithNameAndDescription( 329 AddWithNameAndDescription(
323 IDR_CHROME_APPS_WEBSTORE_WIDGET_MANIFEST, 330 IDR_CHROME_APPS_WEBSTORE_WIDGET_MANIFEST,
324 base::FilePath(FILE_PATH_LITERAL("webstore_widget")), 331 base::FilePath(FILE_PATH_LITERAL("webstore_widget")),
325 l10n_util::GetStringUTF8(IDS_WEBSTORE_WIDGET_APP_NAME), 332 l10n_util::GetStringUTF8(IDS_WEBSTORE_WIDGET_APP_NAME),
326 l10n_util::GetStringUTF8(IDS_WEBSTORE_WIDGET_APP_DESC)); 333 l10n_util::GetStringUTF8(IDS_WEBSTORE_WIDGET_APP_DESC));
327 #endif 334 #endif
328 } 335 }
329 336
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 ash::GetChromeOSDeviceName())); 555 ash::GetChromeOSDeviceName()));
549 #endif 556 #endif
550 557
551 if (!skip_session_components) { 558 if (!skip_session_components) {
552 AddVideoPlayerExtension(); 559 AddVideoPlayerExtension();
553 AddAudioPlayerExtension(); 560 AddAudioPlayerExtension();
554 AddFileManagerExtension(); 561 AddFileManagerExtension();
555 AddGalleryExtension(); 562 AddGalleryExtension();
556 AddWebstoreWidgetExtension(); 563 AddWebstoreWidgetExtension();
557 564
565 #if defined(OS_CHROMEOS)
benwells 2017/04/14 05:12:32 why do you need the flag here and in the body of A
566 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
567 chromeos::switches::kEnableZipArchiverOnFileManager)) {
568 AddZipArchiverExtension();
569 }
570 #endif
571
558 AddHangoutServicesExtension(); 572 AddHangoutServicesExtension();
559 AddHotwordAudioVerificationApp(); 573 AddHotwordAudioVerificationApp();
560 AddHotwordHelperExtension(); 574 AddHotwordHelperExtension();
561 AddImageLoaderExtension(); 575 AddImageLoaderExtension();
562 576
563 bool install_feedback = enable_background_extensions_during_testing; 577 bool install_feedback = enable_background_extensions_during_testing;
564 #if defined(GOOGLE_CHROME_BUILD) 578 #if defined(GOOGLE_CHROME_BUILD)
565 install_feedback = true; 579 install_feedback = true;
566 #endif // defined(GOOGLE_CHROME_BUILD) 580 #endif // defined(GOOGLE_CHROME_BUILD)
567 if (install_feedback) 581 if (install_feedback)
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 return; // Error already logged. 698 return; // Error already logged.
685 std::string actual_extension_id = 699 std::string actual_extension_id =
686 Add(std::move(manifest), root_directory, false); 700 Add(std::move(manifest), root_directory, false);
687 CHECK_EQ(extension_id, actual_extension_id); 701 CHECK_EQ(extension_id, actual_extension_id);
688 if (!done_cb.is_null()) 702 if (!done_cb.is_null())
689 done_cb.Run(); 703 done_cb.Run();
690 } 704 }
691 #endif 705 #endif
692 706
693 } // namespace extensions 707 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/component_loader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698