Chromium Code Reviews| 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/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 302 void ComponentLoader::AddHangoutServicesExtension() { | 302 void ComponentLoader::AddHangoutServicesExtension() { |
| 303 #if defined(GOOGLE_CHROME_BUILD) || defined(ENABLE_HANGOUT_SERVICES_EXTENSION) | 303 #if defined(GOOGLE_CHROME_BUILD) || defined(ENABLE_HANGOUT_SERVICES_EXTENSION) |
| 304 Add(IDR_HANGOUT_SERVICES_MANIFEST, | 304 Add(IDR_HANGOUT_SERVICES_MANIFEST, |
| 305 base::FilePath(FILE_PATH_LITERAL("hangout_services"))); | 305 base::FilePath(FILE_PATH_LITERAL("hangout_services"))); |
| 306 #endif | 306 #endif |
| 307 } | 307 } |
| 308 | 308 |
| 309 void ComponentLoader::AddHotwordHelperExtension() { | 309 void ComponentLoader::AddHotwordHelperExtension() { |
| 310 #if defined(ENABLE_EXTENSIONS) | 310 #if defined(ENABLE_EXTENSIONS) |
| 311 if (HotwordServiceFactory::IsHotwordAllowed(browser_context_)) { | 311 if (HotwordServiceFactory::IsHotwordAllowed(browser_context_)) { |
| 312 Add(IDR_HOTWORD_HELPER_MANIFEST, | 312 bool loadedHotwordExtension = false; |
| 313 base::FilePath(FILE_PATH_LITERAL("hotword_helper"))); | 313 #if defined(OS_CHROMEOS) |
|
James Hawkins
2014/08/05 08:59:45
Please get rid of this #ifdef by creating a Chrome
Anand Mistry (off Chromium)
2014/08/06 01:46:07
I've been meaning to change this flag and move it
| |
| 314 CommandLine* command_line = CommandLine::ForCurrentProcess(); | |
| 315 loadedHotwordExtension = | |
| 316 command_line->HasSwitch(chromeos::switches::kEnableOkGoogleVoiceSearch); | |
| 317 if (loadedHotwordExtension) { | |
| 318 Add(IDR_HOTWORD_MANIFEST, | |
| 319 base::FilePath(FILE_PATH_LITERAL("hotword"))); | |
| 320 } | |
| 321 #endif // defined(OS_CHROMEOS) | |
| 322 if (!loadedHotwordExtension) { | |
| 323 Add(IDR_HOTWORD_HELPER_MANIFEST, | |
| 324 base::FilePath(FILE_PATH_LITERAL("hotword_helper"))); | |
| 325 } | |
| 314 } | 326 } |
| 315 #endif | 327 #endif |
| 316 } | 328 } |
| 317 | 329 |
| 318 void ComponentLoader::AddImageLoaderExtension() { | 330 void ComponentLoader::AddImageLoaderExtension() { |
| 319 #if defined(IMAGE_LOADER_EXTENSION) | 331 #if defined(IMAGE_LOADER_EXTENSION) |
| 320 Add(IDR_IMAGE_LOADER_MANIFEST, | 332 Add(IDR_IMAGE_LOADER_MANIFEST, |
| 321 base::FilePath(FILE_PATH_LITERAL("image_loader"))); | 333 base::FilePath(FILE_PATH_LITERAL("image_loader"))); |
| 322 #endif // defined(IMAGE_LOADER_EXTENSION) | 334 #endif // defined(IMAGE_LOADER_EXTENSION) |
| 323 } | 335 } |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 658 off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); | 670 off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); |
| 659 fileapi::FileSystemContext* file_system_context = | 671 fileapi::FileSystemContext* file_system_context = |
| 660 content::BrowserContext::GetStoragePartitionForSite( | 672 content::BrowserContext::GetStoragePartitionForSite( |
| 661 off_the_record_context, site)->GetFileSystemContext(); | 673 off_the_record_context, site)->GetFileSystemContext(); |
| 662 file_system_context->EnableTemporaryFileSystemInIncognito(); | 674 file_system_context->EnableTemporaryFileSystemInIncognito(); |
| 663 } | 675 } |
| 664 #endif | 676 #endif |
| 665 } | 677 } |
| 666 | 678 |
| 667 } // namespace extensions | 679 } // namespace extensions |
| OLD | NEW |