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

Unified Diff: chrome/browser/extensions/component_loader.cc

Issue 2291133005: Re-land: Move ChromeVox loading out of ComponentLoader. (Closed)
Patch Set: Add ChromeVox to this profile if needed Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/component_loader.cc
diff --git a/chrome/browser/extensions/component_loader.cc b/chrome/browser/extensions/component_loader.cc
index 128aca7b401a15fb560b5afbb8c4c1876985f7c7..bf6d991a1298d2e3ae9631e8c0c0f90592d010c3 100644
--- a/chrome/browser/extensions/component_loader.cc
+++ b/chrome/browser/extensions/component_loader.cc
@@ -374,30 +374,8 @@ void ComponentLoader::AddNetworkSpeechSynthesisExtension() {
}
#if defined(OS_CHROMEOS)
-void ComponentLoader::AddChromeVoxExtension(
- const base::Closure& done_cb) {
- base::FilePath resources_path;
- CHECK(PathService::Get(chrome::DIR_RESOURCES, &resources_path));
-
- base::FilePath chromevox_path =
- resources_path.Append(extension_misc::kChromeVoxExtensionPath);
-
- const base::FilePath::CharType* manifest_filename =
- IsNormalSession() ? extensions::kManifestFilename
- : extension_misc::kGuestManifestFilename;
- AddWithManifestFile(
- manifest_filename,
- chromevox_path,
- extension_misc::kChromeVoxExtensionId,
- done_cb);
-}
-
void ComponentLoader::AddChromeOsSpeechSynthesisExtension() {
- const base::FilePath::CharType* manifest_filename =
- IsNormalSession() ? extensions::kManifestFilename
- : extension_misc::kGuestManifestFilename;
- AddWithManifestFile(
- manifest_filename,
+ AddComponentFromDir(
base::FilePath(extension_misc::kSpeechSynthesisExtensionPath),
extension_misc::kSpeechSynthesisExtensionId,
base::Bind(&ComponentLoader::EnableFileSystemInGuestMode,
@@ -622,12 +600,6 @@ void ComponentLoader::AddDefaultComponentExtensionsWithBackgroundPages(
Add(IDR_ARC_SUPPORT_MANIFEST,
base::FilePath(FILE_PATH_LITERAL("chromeos/arc_support")));
}
-
- // Load ChromeVox extension now if spoken feedback is enabled.
- if (chromeos::AccessibilityManager::Get() &&
- chromeos::AccessibilityManager::Get()->IsSpokenFeedbackEnabled()) {
- AddChromeVoxExtension(base::Closure());
- }
#endif // defined(OS_CHROMEOS)
#if defined(GOOGLE_CHROME_BUILD)
@@ -686,24 +658,26 @@ void ComponentLoader::EnableFileSystemInGuestMode(const std::string& id) {
}
#if defined(OS_CHROMEOS)
-void ComponentLoader::AddWithManifestFile(
- const base::FilePath::CharType* manifest_filename,
+void ComponentLoader::AddComponentFromDir(
const base::FilePath& root_directory,
const char* extension_id,
const base::Closure& done_cb) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ const base::FilePath::CharType* manifest_filename =
+ IsNormalSession() ? extensions::kManifestFilename
+ : extension_misc::kGuestManifestFilename;
BrowserThread::PostTaskAndReplyWithResult(
BrowserThread::FILE,
FROM_HERE,
base::Bind(&LoadManifestOnFileThread, root_directory, manifest_filename),
- base::Bind(&ComponentLoader::FinishAddWithManifestFile,
+ base::Bind(&ComponentLoader::FinishAddComponentFromDir,
weak_factory_.GetWeakPtr(),
root_directory,
extension_id,
done_cb));
}
-void ComponentLoader::FinishAddWithManifestFile(
+void ComponentLoader::FinishAddComponentFromDir(
const base::FilePath& root_directory,
const char* extension_id,
const base::Closure& done_cb,
« chrome/browser/extensions/component_loader.h ('K') | « chrome/browser/extensions/component_loader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698