Chromium Code Reviews| 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; |