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

Unified Diff: chrome/browser/supervised_user/supervised_user_service.cc

Issue 614053002: Supervised Users: Add tests for PermissionRequestCreatorApiary. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 3 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/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 5e79d34e424f17bc2e3e7770e9f0e4899ca1d358..0ce61d9b7103276d47b63fd1f4ee4a83eed14e43 100644
--- a/chrome/browser/supervised_user/supervised_user_service.cc
+++ b/chrome/browser/supervised_user/supervised_user_service.cc
@@ -764,12 +764,16 @@ void SupervisedUserService::SetActive(bool active) {
if (active_) {
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kPermissionRequestApiUrl)) {
- scoped_ptr<PermissionRequestCreator> creator =
- PermissionRequestCreatorApiary::CreateWithProfile(
- profile_,
- GURL(CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
- switches::kPermissionRequestApiUrl)));
- permissions_creators_.push_back(creator.release());
+ GURL url(CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kPermissionRequestApiUrl));
+ if (url.is_valid()) {
+ scoped_ptr<PermissionRequestCreator> creator =
+ PermissionRequestCreatorApiary::CreateWithProfile(profile_, url);
+ permissions_creators_.push_back(creator.release());
+ } else {
+ LOG(WARNING) << "Got invalid URL for "
+ << switches::kPermissionRequestApiUrl;
+ }
} else {
permissions_creators_.push_back(new PermissionRequestCreatorSync(
GetSettingsService(),
« no previous file with comments | « chrome/browser/supervised_user/permission_request_creator_apiary_unittest.cc ('k') | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698