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

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

Issue 584313003: Enable runtime switching between ChromeVox and ChromeVox next via command line. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make changes to exclude files/paths from webstore release. Created 6 years, 2 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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 Add(IDR_NETWORK_SPEECH_SYNTHESIS_MANIFEST, 333 Add(IDR_NETWORK_SPEECH_SYNTHESIS_MANIFEST,
334 base::FilePath(FILE_PATH_LITERAL("network_speech_synthesis"))); 334 base::FilePath(FILE_PATH_LITERAL("network_speech_synthesis")));
335 } 335 }
336 336
337 #if defined(OS_CHROMEOS) 337 #if defined(OS_CHROMEOS)
338 void ComponentLoader::AddChromeVoxExtension( 338 void ComponentLoader::AddChromeVoxExtension(
339 const base::Closure& done_cb) { 339 const base::Closure& done_cb) {
340 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 340 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
341 base::FilePath resources_path; 341 base::FilePath resources_path;
342 PathService::Get(chrome::DIR_RESOURCES, &resources_path); 342 PathService::Get(chrome::DIR_RESOURCES, &resources_path);
343
343 base::FilePath chromevox_path = 344 base::FilePath chromevox_path =
344 resources_path.Append(extension_misc::kChromeVoxExtensionPath); 345 resources_path.Append(extension_misc::kChromeVoxExtensionPath);
345 346
346 const CommandLine* command_line = CommandLine::ForCurrentProcess(); 347 const CommandLine* command_line = CommandLine::ForCurrentProcess();
347 const char* manifest_filename = 348 bool is_chromevox_next =
348 command_line->HasSwitch(chromeos::switches::kGuestSession) ? 349 command_line->HasSwitch(chromeos::switches::kEnableChromeVoxNext);
349 extension_misc::kChromeVoxGuestManifestFilename : 350 bool is_guest = command_line->HasSwitch(chromeos::switches::kGuestSession);
350 extension_misc::kChromeVoxManifestFilename; 351 const char* manifest_filename;
352 if (is_chromevox_next) {
353 manifest_filename =
354 is_guest ? extension_misc::kChromeVoxNextGuestManifestFilename
355 : extension_misc::kChromeVoxNextManifestFilename;
356 } else {
357 manifest_filename =
358 is_guest ? extension_misc::kChromeVoxGuestManifestFilename
359 : extension_misc::kChromeVoxManifestFilename;
360 }
351 BrowserThread::PostTaskAndReplyWithResult( 361 BrowserThread::PostTaskAndReplyWithResult(
352 BrowserThread::FILE, 362 BrowserThread::FILE,
353 FROM_HERE, 363 FROM_HERE,
354 base::Bind(&LoadManifestOnFileThread, chromevox_path, manifest_filename), 364 base::Bind(&LoadManifestOnFileThread, chromevox_path, manifest_filename),
355 base::Bind(&ComponentLoader::AddChromeVoxExtensionWithManifest, 365 base::Bind(&ComponentLoader::AddChromeVoxExtensionWithManifest,
356 weak_factory_.GetWeakPtr(), 366 weak_factory_.GetWeakPtr(),
357 chromevox_path, 367 chromevox_path,
358 done_cb)); 368 done_cb));
359 } 369 }
360 370
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); 650 off_the_record_context, Extension::GetBaseURLFromExtensionId(id));
641 storage::FileSystemContext* file_system_context = 651 storage::FileSystemContext* file_system_context =
642 content::BrowserContext::GetStoragePartitionForSite( 652 content::BrowserContext::GetStoragePartitionForSite(
643 off_the_record_context, site)->GetFileSystemContext(); 653 off_the_record_context, site)->GetFileSystemContext();
644 file_system_context->EnableTemporaryFileSystemInIncognito(); 654 file_system_context->EnableTemporaryFileSystemInIncognito();
645 } 655 }
646 #endif 656 #endif
647 } 657 }
648 658
649 } // namespace extensions 659 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698