| 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/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 void ComponentLoader::AddChromeVoxExtension( | 349 void ComponentLoader::AddChromeVoxExtension( |
| 350 const base::Closure& done_cb) { | 350 const base::Closure& done_cb) { |
| 351 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 351 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 352 base::FilePath resources_path; | 352 base::FilePath resources_path; |
| 353 PathService::Get(chrome::DIR_RESOURCES, &resources_path); | 353 PathService::Get(chrome::DIR_RESOURCES, &resources_path); |
| 354 | 354 |
| 355 base::FilePath chromevox_path = | 355 base::FilePath chromevox_path = |
| 356 resources_path.Append(extension_misc::kChromeVoxExtensionPath); | 356 resources_path.Append(extension_misc::kChromeVoxExtensionPath); |
| 357 | 357 |
| 358 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 358 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 359 bool is_chromevox_next = | |
| 360 command_line->HasSwitch(chromeos::switches::kEnableChromeVoxNext); | |
| 361 bool is_guest = command_line->HasSwitch(chromeos::switches::kGuestSession); | 359 bool is_guest = command_line->HasSwitch(chromeos::switches::kGuestSession); |
| 362 const char* manifest_filename; | 360 const char* manifest_filename = |
| 363 if (is_chromevox_next) { | 361 is_guest ? extension_misc::kChromeVoxGuestManifestFilename |
| 364 manifest_filename = | 362 : extension_misc::kChromeVoxManifestFilename; |
| 365 is_guest ? extension_misc::kChromeVoxNextGuestManifestFilename | 363 |
| 366 : extension_misc::kChromeVoxNextManifestFilename; | |
| 367 } else { | |
| 368 manifest_filename = | |
| 369 is_guest ? extension_misc::kChromeVoxGuestManifestFilename | |
| 370 : extension_misc::kChromeVoxManifestFilename; | |
| 371 } | |
| 372 BrowserThread::PostTaskAndReplyWithResult( | 364 BrowserThread::PostTaskAndReplyWithResult( |
| 373 BrowserThread::FILE, | 365 BrowserThread::FILE, |
| 374 FROM_HERE, | 366 FROM_HERE, |
| 375 base::Bind(&LoadManifestOnFileThread, chromevox_path, manifest_filename), | 367 base::Bind(&LoadManifestOnFileThread, chromevox_path, manifest_filename), |
| 376 base::Bind(&ComponentLoader::AddChromeVoxExtensionWithManifest, | 368 base::Bind(&ComponentLoader::AddChromeVoxExtensionWithManifest, |
| 377 weak_factory_.GetWeakPtr(), | 369 weak_factory_.GetWeakPtr(), |
| 378 chromevox_path, | 370 chromevox_path, |
| 379 done_cb)); | 371 done_cb)); |
| 380 } | 372 } |
| 381 | 373 |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); | 650 off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); |
| 659 storage::FileSystemContext* file_system_context = | 651 storage::FileSystemContext* file_system_context = |
| 660 content::BrowserContext::GetStoragePartitionForSite( | 652 content::BrowserContext::GetStoragePartitionForSite( |
| 661 off_the_record_context, site)->GetFileSystemContext(); | 653 off_the_record_context, site)->GetFileSystemContext(); |
| 662 file_system_context->EnableTemporaryFileSystemInIncognito(); | 654 file_system_context->EnableTemporaryFileSystemInIncognito(); |
| 663 } | 655 } |
| 664 #endif | 656 #endif |
| 665 } | 657 } |
| 666 | 658 |
| 667 } // namespace extensions | 659 } // namespace extensions |
| OLD | NEW |