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

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

Issue 2229833002: Revert of Move ChromeVox loading out of ComponentLoader. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « chrome/browser/extensions/component_loader.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/component_loader.cc
diff --git a/chrome/browser/extensions/component_loader.cc b/chrome/browser/extensions/component_loader.cc
index a85f217c4f6e92ee520062887b10b8431747d4d7..c6289573007995aa59ce773c6df3a42f610372fa 100644
--- a/chrome/browser/extensions/component_loader.cc
+++ b/chrome/browser/extensions/component_loader.cc
@@ -56,6 +56,7 @@
#endif
#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
#include "chromeos/chromeos_switches.h"
#include "content/public/browser/site_instance.h"
#include "content/public/browser/storage_partition.h"
@@ -376,8 +377,30 @@
}
#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() {
- AddComponentFromDir(
+ const base::FilePath::CharType* manifest_filename =
+ IsNormalSession() ? extensions::kManifestFilename
+ : extension_misc::kGuestManifestFilename;
+ AddWithManifestFile(
+ manifest_filename,
base::FilePath(extension_misc::kSpeechSynthesisExtensionPath),
extension_misc::kSpeechSynthesisExtensionId,
base::Bind(&ComponentLoader::EnableFileSystemInGuestMode,
@@ -601,6 +624,12 @@
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)
@@ -660,26 +689,24 @@
}
#if defined(OS_CHROMEOS)
-void ComponentLoader::AddComponentFromDir(
+void ComponentLoader::AddWithManifestFile(
+ const base::FilePath::CharType* manifest_filename,
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::FinishAddComponentFromDir,
+ base::Bind(&ComponentLoader::FinishAddWithManifestFile,
weak_factory_.GetWeakPtr(),
root_directory,
extension_id,
done_cb));
}
-void ComponentLoader::FinishAddComponentFromDir(
+void ComponentLoader::FinishAddWithManifestFile(
const base::FilePath& root_directory,
const char* extension_id,
const base::Closure& done_cb,
« no previous file with comments | « chrome/browser/extensions/component_loader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698