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

Unified Diff: chrome/browser/extensions/api/cloud_print_private/cloud_print_private_api.cc

Issue 1898503002: Cleanup LocalDiscoveryUIHandler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/extensions/api/cloud_print_private/cloud_print_private_api.cc
diff --git a/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_api.cc b/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_api.cc
index 2f590068b522982da0c1e9ebfe0a242cc3bfe831..a367bb1b0ada3460379312651e14e714a3acd804 100644
--- a/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_api.cc
+++ b/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_api.cc
@@ -48,16 +48,14 @@ bool CloudPrintPrivateSetupConnectorFunction::RunAsync() {
params->credentials,
params->user_settings);
} else {
+ std::unique_ptr<base::DictionaryValue> user_settings(
+ params->user_settings.ToValue());
CloudPrintProxyService* service =
CloudPrintProxyServiceFactory::GetForProfile(GetProfile());
- if (!service)
- return false;
Vitaly Buka (NO REVIEWS) 2016/04/16 01:33:52 I guess this could be NULL for for incognito.
Lei Zhang 2016/04/16 01:53:19 Ok, I will look into this. How is this API used an
Vitaly Buka (NO REVIEWS) 2016/04/16 02:17:56 Test would be nice. This API used only by https:/
- std::unique_ptr<base::DictionaryValue> user_setings(
- params->user_settings.ToValue());
service->EnableForUserWithRobot(params->credentials,
params->robot_email,
params->user_email,
- *user_setings);
+ *user_settings);
}
SendResponse(true);
return true;
@@ -99,11 +97,7 @@ bool CloudPrintPrivateGetPrintersFunction::RunAsync() {
if (CloudPrintTestsDelegate::instance()) {
SendResults(CloudPrintTestsDelegate::instance()->GetPrinters());
} else {
- CloudPrintProxyService* service =
- CloudPrintProxyServiceFactory::GetForProfile(GetProfile());
- if (!service)
- return false;
- service->GetPrinters(
+ CloudPrintProxyServiceFactory::GetForProfile(GetProfile())->GetPrinters(
base::Bind(&CloudPrintPrivateGetPrintersFunction::SendResults, this));
}
return true;

Powered by Google App Engine
This is Rietveld 408576698