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

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/file_util.h" 10 #include "base/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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 Add(IDR_BOOKMARKS_MANIFEST, 459 Add(IDR_BOOKMARKS_MANIFEST,
452 base::FilePath(FILE_PATH_LITERAL("bookmark_manager"))); 460 base::FilePath(FILE_PATH_LITERAL("bookmark_manager")));
453 // Cloud Print component app. Not required on Chrome OS. 461 // Cloud Print component app. Not required on Chrome OS.
454 Add(IDR_CLOUDPRINT_MANIFEST, 462 Add(IDR_CLOUDPRINT_MANIFEST,
455 base::FilePath(FILE_PATH_LITERAL("cloud_print"))); 463 base::FilePath(FILE_PATH_LITERAL("cloud_print")));
456 #endif 464 #endif
457 465
458 if (!skip_session_components) { 466 if (!skip_session_components) {
459 AddWebStoreApp(); 467 AddWebStoreApp();
460 AddChromeApp(); 468 AddChromeApp();
469 AddHotwordAudioVerificationApp();
benwells 2014/08/25 03:21:58 I think tihs should be moved down to AddDefaultCom
kcarattini 2014/08/25 04:04:25 Done.
461 } 470 }
462 471
463 AddKeyboardApp(); 472 AddKeyboardApp();
464 473
465 AddDefaultComponentExtensionsWithBackgroundPages(skip_session_components); 474 AddDefaultComponentExtensionsWithBackgroundPages(skip_session_components);
466 } 475 }
467 476
468 void ComponentLoader::AddDefaultComponentExtensionsForKioskMode( 477 void ComponentLoader::AddDefaultComponentExtensionsForKioskMode(
469 bool skip_session_components) { 478 bool skip_session_components) {
470 // No component extension for kiosk app launch splash screen. 479 // No component extension for kiosk app launch splash screen.
(...skipping 162 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 fileapi::FileSystemContext* file_system_context = 643 fileapi::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