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 <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 #endif // defined(IMAGE_LOADER_EXTENSION) | 320 #endif // defined(IMAGE_LOADER_EXTENSION) |
321 } | 321 } |
322 | 322 |
323 void ComponentLoader::AddNetworkSpeechSynthesisExtension() { | 323 void ComponentLoader::AddNetworkSpeechSynthesisExtension() { |
324 Add(IDR_NETWORK_SPEECH_SYNTHESIS_MANIFEST, | 324 Add(IDR_NETWORK_SPEECH_SYNTHESIS_MANIFEST, |
325 base::FilePath(FILE_PATH_LITERAL("network_speech_synthesis"))); | 325 base::FilePath(FILE_PATH_LITERAL("network_speech_synthesis"))); |
326 } | 326 } |
327 | 327 |
328 #if defined(OS_CHROMEOS) | 328 #if defined(OS_CHROMEOS) |
329 std::string ComponentLoader::AddChromeVoxExtension() { | 329 std::string ComponentLoader::AddChromeVoxExtension() { |
| 330 base::FilePath chromevox_path; |
| 331 PathService::Get(chrome::DIR_RESOURCES, &chromevox_path); |
| 332 chromevox_path = |
| 333 chromevox_path.Append(extension_misc::kChromeVoxExtensionPath); |
| 334 |
330 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 335 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
331 int idr = command_line->HasSwitch(chromeos::switches::kGuestSession) ? | 336 const char* manifest_filename = |
332 IDR_CHROMEVOX_GUEST_MANIFEST : IDR_CHROMEVOX_MANIFEST; | 337 command_line->HasSwitch(chromeos::switches::kGuestSession) ? |
| 338 extension_misc::kChromeVoxGuestManifestFilename : |
| 339 extension_misc::kChromeVoxManifestFilename; |
333 | 340 |
334 // TODO(dtseng): Guest mode manifest for ChromeVox Next pending work to | 341 std::string error; |
335 // generate manifests. | 342 scoped_ptr<base::DictionaryValue> manifest( |
336 if (command_line->HasSwitch(chromeos::switches::kEnableChromeVoxNext)) | 343 file_util::LoadManifest(chromevox_path, manifest_filename, &error)); |
337 idr = IDR_CHROMEVOX2_MANIFEST; | 344 CHECK(manifest) << error; |
338 return Add(idr, base::FilePath(extension_misc::kChromeVoxExtensionPath)); | 345 |
| 346 return Add(manifest.release(), chromevox_path); |
339 } | 347 } |
340 | 348 |
341 std::string ComponentLoader::AddChromeOsSpeechSynthesisExtension() { | 349 std::string ComponentLoader::AddChromeOsSpeechSynthesisExtension() { |
342 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 350 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
343 int idr = command_line->HasSwitch(chromeos::switches::kGuestSession) ? | 351 int idr = command_line->HasSwitch(chromeos::switches::kGuestSession) ? |
344 IDR_SPEECH_SYNTHESIS_GUEST_MANIFEST : IDR_SPEECH_SYNTHESIS_MANIFEST; | 352 IDR_SPEECH_SYNTHESIS_GUEST_MANIFEST : IDR_SPEECH_SYNTHESIS_MANIFEST; |
345 std::string id = Add(idr, | 353 std::string id = Add(idr, |
346 base::FilePath(extension_misc::kSpeechSynthesisExtensionPath)); | 354 base::FilePath(extension_misc::kSpeechSynthesisExtensionPath)); |
347 EnableFileSystemInGuestMode(id); | 355 EnableFileSystemInGuestMode(id); |
348 return id; | 356 return id; |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); | 632 off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); |
625 fileapi::FileSystemContext* file_system_context = | 633 fileapi::FileSystemContext* file_system_context = |
626 content::BrowserContext::GetStoragePartitionForSite( | 634 content::BrowserContext::GetStoragePartitionForSite( |
627 off_the_record_context, site)->GetFileSystemContext(); | 635 off_the_record_context, site)->GetFileSystemContext(); |
628 file_system_context->EnableTemporaryFileSystemInIncognito(); | 636 file_system_context->EnableTemporaryFileSystemInIncognito(); |
629 } | 637 } |
630 #endif | 638 #endif |
631 } | 639 } |
632 | 640 |
633 } // namespace extensions | 641 } // namespace extensions |
OLD | NEW |