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

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

Issue 743273002: Various changes required to support ChromeVox Next to read Views and Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests. Created 6 years, 1 month 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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 void ComponentLoader::AddChromeVoxExtension( 345 void ComponentLoader::AddChromeVoxExtension(
346 const base::Closure& done_cb) { 346 const base::Closure& done_cb) {
347 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 347 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
348 base::FilePath resources_path; 348 base::FilePath resources_path;
349 PathService::Get(chrome::DIR_RESOURCES, &resources_path); 349 PathService::Get(chrome::DIR_RESOURCES, &resources_path);
350 350
351 base::FilePath chromevox_path = 351 base::FilePath chromevox_path =
352 resources_path.Append(extension_misc::kChromeVoxExtensionPath); 352 resources_path.Append(extension_misc::kChromeVoxExtensionPath);
353 353
354 const CommandLine* command_line = CommandLine::ForCurrentProcess(); 354 const CommandLine* command_line = CommandLine::ForCurrentProcess();
355 bool is_chromevox_next =
356 command_line->HasSwitch(chromeos::switches::kEnableChromeVoxNext);
357 bool is_guest = command_line->HasSwitch(chromeos::switches::kGuestSession); 355 bool is_guest = command_line->HasSwitch(chromeos::switches::kGuestSession);
358 const char* manifest_filename; 356 const char* manifest_filename =
359 if (is_chromevox_next) { 357 is_guest ? extension_misc::kChromeVoxGuestManifestFilename
360 manifest_filename = 358 : extension_misc::kChromeVoxManifestFilename;
361 is_guest ? extension_misc::kChromeVoxNextGuestManifestFilename 359
362 : extension_misc::kChromeVoxNextManifestFilename;
363 } else {
364 manifest_filename =
365 is_guest ? extension_misc::kChromeVoxGuestManifestFilename
366 : extension_misc::kChromeVoxManifestFilename;
367 }
368 BrowserThread::PostTaskAndReplyWithResult( 360 BrowserThread::PostTaskAndReplyWithResult(
369 BrowserThread::FILE, 361 BrowserThread::FILE,
370 FROM_HERE, 362 FROM_HERE,
371 base::Bind(&LoadManifestOnFileThread, chromevox_path, manifest_filename), 363 base::Bind(&LoadManifestOnFileThread, chromevox_path, manifest_filename),
372 base::Bind(&ComponentLoader::AddChromeVoxExtensionWithManifest, 364 base::Bind(&ComponentLoader::AddChromeVoxExtensionWithManifest,
373 weak_factory_.GetWeakPtr(), 365 weak_factory_.GetWeakPtr(),
374 chromevox_path, 366 chromevox_path,
375 done_cb)); 367 done_cb));
376 } 368 }
377 369
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); 646 off_the_record_context, Extension::GetBaseURLFromExtensionId(id));
655 storage::FileSystemContext* file_system_context = 647 storage::FileSystemContext* file_system_context =
656 content::BrowserContext::GetStoragePartitionForSite( 648 content::BrowserContext::GetStoragePartitionForSite(
657 off_the_record_context, site)->GetFileSystemContext(); 649 off_the_record_context, site)->GetFileSystemContext();
658 file_system_context->EnableTemporaryFileSystemInIncognito(); 650 file_system_context->EnableTemporaryFileSystemInIncognito();
659 } 651 }
660 #endif 652 #endif
661 } 653 }
662 654
663 } // namespace extensions 655 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698