Chromium Code Reviews| Index: chrome/browser/extensions/component_loader.cc |
| diff --git a/chrome/browser/extensions/component_loader.cc b/chrome/browser/extensions/component_loader.cc |
| index 0ef7a9f06ac1ebf687cedc88c247795aa21abe19..b27a1306c0db7c2fb3fd6dcf11a1b0cbf140a8d8 100644 |
| --- a/chrome/browser/extensions/component_loader.cc |
| +++ b/chrome/browser/extensions/component_loader.cc |
| @@ -335,8 +335,12 @@ void ComponentLoader::AddNetworkSpeechSynthesisExtension() { |
| #if defined(OS_CHROMEOS) |
| void ComponentLoader::AddChromeOsSpeechSynthesisExtension() { |
| - Add(IDR_SPEECH_SYNTHESIS_MANIFEST, |
| + const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| + int idr = command_line->HasSwitch(chromeos::switches::kGuestSession) ? |
| + IDR_SPEECH_SYNTHESIS_GUEST_MANIFEST : IDR_SPEECH_SYNTHESIS_MANIFEST; |
| + std::string id = Add(idr, |
| base::FilePath(extension_misc::kSpeechSynthesisExtensionPath)); |
| + EnbaleFileSystemInGuestMode(id); |
| } |
| #endif |
| @@ -490,21 +494,7 @@ void ComponentLoader::AddDefaultComponentExtensionsWithBackgroundPages( |
| chromeos::switches::kDisableQuickofficeComponentApp)) { |
| std::string id = Add(IDR_QUICKOFFICE_MANIFEST, base::FilePath( |
| FILE_PATH_LITERAL("/usr/share/chromeos-assets/quick_office"))); |
| - if (command_line->HasSwitch(chromeos::switches::kGuestSession)) { |
| - // TODO(dpolukhin): Hack to enable HTML5 temporary file system for |
| - // Quickoffice. It doesn't work without temporary file system access. |
| - // Make sure temporary file system is enabled in the off the record |
| - // browser context (as that is the one used in guest session). |
| - content::BrowserContext* off_the_record_context = |
| - ExtensionsBrowserClient::Get()->GetOffTheRecordContext( |
| - browser_context_); |
| - GURL site = content::SiteInstance::GetSiteForURL( |
| - off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); |
| - fileapi::FileSystemContext* file_system_context = |
| - content::BrowserContext::GetStoragePartitionForSite( |
| - off_the_record_context, site)->GetFileSystemContext(); |
| - file_system_context->EnableTemporaryFileSystemInIncognito(); |
| - } |
| + EnbaleFileSystemInGuestMode(id); |
| } |
| #endif // defined(GOOGLE_CHROME_BUILD) |
| @@ -538,9 +528,9 @@ void ComponentLoader::AddDefaultComponentExtensionsWithBackgroundPages( |
| // Load ChromeVox extension now if spoken feedback is enabled. |
| if (chromeos::AccessibilityManager::Get() && |
| chromeos::AccessibilityManager::Get()->IsSpokenFeedbackEnabled()) { |
| - base::FilePath path = |
| - base::FilePath(extension_misc::kChromeVoxExtensionPath); |
| - Add(IDR_CHROMEVOX_MANIFEST, path); |
| + int idr = command_line->HasSwitch(chromeos::switches::kGuestSession) ? |
| + IDR_CHROMEVOX_GUEST_MANIFEST : IDR_CHROMEVOX_MANIFEST; |
| + Add(idr, base::FilePath(extension_misc::kChromeVoxExtensionPath)); |
| } |
| #endif // defined(OS_CHROMEOS) |
| @@ -609,4 +599,25 @@ void ComponentLoader::UnloadComponent(ComponentExtensionInfo* component) { |
| } |
| } |
| +void ComponentLoader::EnbaleFileSystemInGuestMode(const std::string& id) { |
| +#if defined(OS_CHROMEOS) |
| + const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| + if (command_line->HasSwitch(chromeos::switches::kGuestSession)) { |
| + // TODO(dpolukhin): Hack to enable HTML5 temporary file system for |
|
asargent_no_longer_on_chrome
2014/02/07 00:09:50
Please file a bug to fix this (is this an extensio
Dmitry Polukhin
2014/02/07 00:20:00
It is not extensions issue. Root of the problem th
|
| + // the extension. Some component extensions don't work without temporary |
| + // file system access. Make sure temporary file system is enabled in the off |
| + // the record browser context (as that is the one used in guest session). |
| + content::BrowserContext* off_the_record_context = |
| + ExtensionsBrowserClient::Get()->GetOffTheRecordContext( |
| + browser_context_); |
| + GURL site = content::SiteInstance::GetSiteForURL( |
| + off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); |
| + fileapi::FileSystemContext* file_system_context = |
| + content::BrowserContext::GetStoragePartitionForSite( |
| + off_the_record_context, site)->GetFileSystemContext(); |
| + file_system_context->EnableTemporaryFileSystemInIncognito(); |
| + } |
| +#endif |
| +} |
| + |
| } // namespace extensions |