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

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

Issue 467113004: Adds a skeleton component app for Always-On Hotwording opt-in flow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 3 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
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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 #endif 294 #endif
295 } 295 }
296 296
297 void ComponentLoader::AddHangoutServicesExtension() { 297 void ComponentLoader::AddHangoutServicesExtension() {
298 #if defined(GOOGLE_CHROME_BUILD) || defined(ENABLE_HANGOUT_SERVICES_EXTENSION) 298 #if defined(GOOGLE_CHROME_BUILD) || defined(ENABLE_HANGOUT_SERVICES_EXTENSION)
299 Add(IDR_HANGOUT_SERVICES_MANIFEST, 299 Add(IDR_HANGOUT_SERVICES_MANIFEST,
300 base::FilePath(FILE_PATH_LITERAL("hangout_services"))); 300 base::FilePath(FILE_PATH_LITERAL("hangout_services")));
301 #endif 301 #endif
302 } 302 }
303 303
304 void ComponentLoader::AddHotwordAudioVerificationApp() {
305 CommandLine* command_line = CommandLine::ForCurrentProcess();
306 if (command_line->HasSwitch(switches::kEnableExperimentalHotwording)) {
307 Add(IDR_HOTWORD_AUDIO_VERIFICATION_MANIFEST,
308 base::FilePath(FILE_PATH_LITERAL("hotword_audio_verification")));
309 }
310 }
311
304 void ComponentLoader::AddHotwordHelperExtension() { 312 void ComponentLoader::AddHotwordHelperExtension() {
305 if (HotwordServiceFactory::IsHotwordAllowed(browser_context_)) { 313 if (HotwordServiceFactory::IsHotwordAllowed(browser_context_)) {
306 CommandLine* command_line = CommandLine::ForCurrentProcess(); 314 CommandLine* command_line = CommandLine::ForCurrentProcess();
307 if (command_line->HasSwitch(switches::kEnableExperimentalHotwording)) { 315 if (command_line->HasSwitch(switches::kEnableExperimentalHotwording)) {
308 Add(IDR_HOTWORD_MANIFEST, 316 Add(IDR_HOTWORD_MANIFEST,
309 base::FilePath(FILE_PATH_LITERAL("hotword"))); 317 base::FilePath(FILE_PATH_LITERAL("hotword")));
310 } else { 318 } else {
311 Add(IDR_HOTWORD_HELPER_MANIFEST, 319 Add(IDR_HOTWORD_HELPER_MANIFEST,
312 base::FilePath(FILE_PATH_LITERAL("hotword_helper"))); 320 base::FilePath(FILE_PATH_LITERAL("hotword_helper")));
313 } 321 }
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 IDS_GENIUS_APP_DESCRIPTION); 511 IDS_GENIUS_APP_DESCRIPTION);
504 } 512 }
505 #endif 513 #endif
506 514
507 if (!skip_session_components) { 515 if (!skip_session_components) {
508 AddVideoPlayerExtension(); 516 AddVideoPlayerExtension();
509 AddFileManagerExtension(); 517 AddFileManagerExtension();
510 AddGalleryExtension(); 518 AddGalleryExtension();
511 519
512 AddHangoutServicesExtension(); 520 AddHangoutServicesExtension();
521 AddHotwordAudioVerificationApp();
513 AddHotwordHelperExtension(); 522 AddHotwordHelperExtension();
514 AddImageLoaderExtension(); 523 AddImageLoaderExtension();
515 524
516 #if defined(ENABLE_SETTINGS_APP) 525 #if defined(ENABLE_SETTINGS_APP)
517 Add(IDR_SETTINGS_APP_MANIFEST, 526 Add(IDR_SETTINGS_APP_MANIFEST,
518 base::FilePath(FILE_PATH_LITERAL("settings_app"))); 527 base::FilePath(FILE_PATH_LITERAL("settings_app")));
519 #endif 528 #endif
520 } 529 }
521 530
522 // If (!enable_background_extensions_during_testing || this isn't a test) 531 // If (!enable_background_extensions_during_testing || this isn't a test)
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); 642 off_the_record_context, Extension::GetBaseURLFromExtensionId(id));
634 storage::FileSystemContext* file_system_context = 643 storage::FileSystemContext* file_system_context =
635 content::BrowserContext::GetStoragePartitionForSite( 644 content::BrowserContext::GetStoragePartitionForSite(
636 off_the_record_context, site)->GetFileSystemContext(); 645 off_the_record_context, site)->GetFileSystemContext();
637 file_system_context->EnableTemporaryFileSystemInIncognito(); 646 file_system_context->EnableTemporaryFileSystemInIncognito();
638 } 647 }
639 #endif 648 #endif
640 } 649 }
641 650
642 } // namespace extensions 651 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/component_loader.h ('k') | chrome/browser/resources/component_extension_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698