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 14bdbbf31a5f27b0b59d77430d95b49a72db31bb..c2fc3f5b452468ea641fc695bf5b85dac23554e6 100644 |
| --- a/chrome/browser/extensions/component_loader.cc |
| +++ b/chrome/browser/extensions/component_loader.cc |
| @@ -32,6 +32,7 @@ |
| #include "ui/base/resource/resource_bundle.h" |
| #if defined(OS_CHROMEOS) |
| +#include "components/user_manager/user_manager.h" |
| #include "grit/keyboard_resources.h" |
| #include "ui/file_manager/grit/file_manager_resources.h" |
| #include "ui/keyboard/keyboard_util.h" |
| @@ -358,10 +359,13 @@ void ComponentLoader::AddChromeVoxExtension( |
| const base::CommandLine* command_line = |
| base::CommandLine::ForCurrentProcess(); |
| - bool is_guest = command_line->HasSwitch(chromeos::switches::kGuestSession); |
| + bool is_normal_session = |
| + !command_line->HasSwitch(chromeos::switches::kGuestSession) && |
| + user_manager::UserManager::Get()->IsUserLoggedIn(); |
|
not at google - send to devlin
2015/01/21 23:57:52
How about adding an IsNormalSession() method and u
David Tseng
2015/01/22 00:49:38
Done.
|
| + |
| const char* manifest_filename = |
| - is_guest ? extension_misc::kChromeVoxGuestManifestFilename |
| - : extension_misc::kChromeVoxManifestFilename; |
| + is_normal_session ? extension_misc::kChromeVoxManifestFilename |
| + : extension_misc::kChromeVoxGuestManifestFilename; |
| BrowserThread::PostTaskAndReplyWithResult( |
| BrowserThread::FILE, |
| @@ -387,8 +391,10 @@ void ComponentLoader::AddChromeVoxExtensionWithManifest( |
| std::string ComponentLoader::AddChromeOsSpeechSynthesisExtension() { |
| const base::CommandLine* command_line = |
| base::CommandLine::ForCurrentProcess(); |
| - int idr = command_line->HasSwitch(chromeos::switches::kGuestSession) ? |
| - IDR_SPEECH_SYNTHESIS_GUEST_MANIFEST : IDR_SPEECH_SYNTHESIS_MANIFEST; |
| + int idr = user_manager::UserManager::Get()->IsUserLoggedIn() && |
| + !command_line->HasSwitch(chromeos::switches::kGuestSession) |
| + ? IDR_SPEECH_SYNTHESIS_MANIFEST |
| + : IDR_SPEECH_SYNTHESIS_GUEST_MANIFEST; |
| std::string id = Add(idr, |
| base::FilePath(extension_misc::kSpeechSynthesisExtensionPath)); |
| EnableFileSystemInGuestMode(id); |
| @@ -647,7 +653,8 @@ void ComponentLoader::EnableFileSystemInGuestMode(const std::string& id) { |
| #if defined(OS_CHROMEOS) |
| const base::CommandLine* command_line = |
| base::CommandLine::ForCurrentProcess(); |
| - if (command_line->HasSwitch(chromeos::switches::kGuestSession)) { |
| + if (command_line->HasSwitch(chromeos::switches::kGuestSession) || |
| + !user_manager::UserManager::Get()->IsUserLoggedIn()) { |
| // TODO(dpolukhin): Hack to enable HTML5 temporary file system for |
| // the extension. Some component extensions don't work without temporary |
| // file system access. Make sure temporary file system is enabled in the off |