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

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

Issue 295123002: Provide script/gypi support for manifest generation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 7 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 | Annotate | Revision Log
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 <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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 #endif // defined(IMAGE_LOADER_EXTENSION) 322 #endif // defined(IMAGE_LOADER_EXTENSION)
323 } 323 }
324 324
325 void ComponentLoader::AddNetworkSpeechSynthesisExtension() { 325 void ComponentLoader::AddNetworkSpeechSynthesisExtension() {
326 Add(IDR_NETWORK_SPEECH_SYNTHESIS_MANIFEST, 326 Add(IDR_NETWORK_SPEECH_SYNTHESIS_MANIFEST,
327 base::FilePath(FILE_PATH_LITERAL("network_speech_synthesis"))); 327 base::FilePath(FILE_PATH_LITERAL("network_speech_synthesis")));
328 } 328 }
329 329
330 #if defined(OS_CHROMEOS) 330 #if defined(OS_CHROMEOS)
331 std::string ComponentLoader::AddChromeVoxExtension() { 331 std::string ComponentLoader::AddChromeVoxExtension() {
332 base::FilePath chromevox_path;
333 PathService::Get(chrome::DIR_RESOURCES, &chromevox_path);
334 chromevox_path =
335 chromevox_path.Append(extension_misc::kChromeVoxExtensionPath);
336
332 const CommandLine* command_line = CommandLine::ForCurrentProcess(); 337 const CommandLine* command_line = CommandLine::ForCurrentProcess();
333 int idr = command_line->HasSwitch(chromeos::switches::kGuestSession) ? 338 const char* manifest_filename =
334 IDR_CHROMEVOX_GUEST_MANIFEST : IDR_CHROMEVOX_MANIFEST; 339 command_line->HasSwitch(chromeos::switches::kGuestSession) ?
340 extension_misc::kChromeVoxGuestManifestFilename :
341 extension_misc::kChromeVoxManifestFilename;
335 342
336 // TODO(dtseng): Guest mode manifest for ChromeVox Next pending work to 343 std::string error;
337 // generate manifests. 344 scoped_ptr<base::DictionaryValue> manifest(
338 if (command_line->HasSwitch(chromeos::switches::kEnableChromeVoxNext)) 345 file_util::LoadManifest(chromevox_path, manifest_filename, &error));
339 idr = IDR_CHROMEVOX2_MANIFEST; 346 CHECK(manifest) << error;
340 return Add(idr, base::FilePath(extension_misc::kChromeVoxExtensionPath)); 347
348 return Add(manifest.release(), chromevox_path);
341 } 349 }
342 350
343 std::string ComponentLoader::AddChromeOsSpeechSynthesisExtension() { 351 std::string ComponentLoader::AddChromeOsSpeechSynthesisExtension() {
344 const CommandLine* command_line = CommandLine::ForCurrentProcess(); 352 const CommandLine* command_line = CommandLine::ForCurrentProcess();
345 int idr = command_line->HasSwitch(chromeos::switches::kGuestSession) ? 353 int idr = command_line->HasSwitch(chromeos::switches::kGuestSession) ?
346 IDR_SPEECH_SYNTHESIS_GUEST_MANIFEST : IDR_SPEECH_SYNTHESIS_MANIFEST; 354 IDR_SPEECH_SYNTHESIS_GUEST_MANIFEST : IDR_SPEECH_SYNTHESIS_MANIFEST;
347 std::string id = Add(idr, 355 std::string id = Add(idr,
348 base::FilePath(extension_misc::kSpeechSynthesisExtensionPath)); 356 base::FilePath(extension_misc::kSpeechSynthesisExtensionPath));
349 EnableFileSystemInGuestMode(id); 357 EnableFileSystemInGuestMode(id);
350 return id; 358 return id;
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); 627 off_the_record_context, Extension::GetBaseURLFromExtensionId(id));
620 fileapi::FileSystemContext* file_system_context = 628 fileapi::FileSystemContext* file_system_context =
621 content::BrowserContext::GetStoragePartitionForSite( 629 content::BrowserContext::GetStoragePartitionForSite(
622 off_the_record_context, site)->GetFileSystemContext(); 630 off_the_record_context, site)->GetFileSystemContext();
623 file_system_context->EnableTemporaryFileSystemInIncognito(); 631 file_system_context->EnableTemporaryFileSystemInIncognito();
624 } 632 }
625 #endif 633 #endif
626 } 634 }
627 635
628 } // namespace extensions 636 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/browser_resources.grd ('k') | chrome/browser/resources/chromeos/chromevox/chromevox.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698