Chromium Code Reviews| Index: chrome/browser/supervised_user/supervised_user_service.cc |
| diff --git a/chrome/browser/supervised_user/supervised_user_service.cc b/chrome/browser/supervised_user/supervised_user_service.cc |
| index 564977f24909f543f0a9255b5d28659177739052..fae5bd026e36074073b3c422bdd93508bcc8dce8 100644 |
| --- a/chrome/browser/supervised_user/supervised_user_service.cc |
| +++ b/chrome/browser/supervised_user/supervised_user_service.cc |
| @@ -753,9 +753,19 @@ void SupervisedUserService::SetActive(bool active) { |
| if (active_) { |
| if (CommandLine::ForCurrentProcess()->HasSwitch( |
| switches::kPermissionRequestApiUrl)) { |
| - permissions_creator_ = |
| - PermissionRequestCreatorApiary::CreateWithProfile(profile_); |
| - } else { |
| + std::string value = CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| + switches::kPermissionRequestApiUrl); |
| + GURL url(value); |
|
Bernhard Bauer
2014/09/30 15:01:08
You could probably inline |value|.
Marc Treib
2014/09/30 15:28:46
Done.
|
| + if (url.is_valid()) { |
| + permissions_creator_ = |
| + PermissionRequestCreatorApiary::CreateWithProfile(url, profile_); |
| + } else { |
| + LOG(WARNING) << "Got invalid URL for " |
| + << switches::kPermissionRequestApiUrl |
| + << ", falling back to PermissionRequestCreatorSync"; |
| + } |
| + } |
| + if (!permissions_creator_) { |
| PrefService* pref_service = profile_->GetPrefs(); |
| permissions_creator_.reset(new PermissionRequestCreatorSync( |
| settings_service, |