| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h" | 5 #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 base::UTF8ToUTF16(email)); | 597 base::UTF8ToUTF16(email)); |
| 598 } | 598 } |
| 599 base::StringValue label(label_str); | 599 base::StringValue label(label_str); |
| 600 | 600 |
| 601 web_ui()->CallJavascriptFunction( | 601 web_ui()->CallJavascriptFunction( |
| 602 "local_discovery.setupCloudPrintConnectorSection", disabled, label, | 602 "local_discovery.setupCloudPrintConnectorSection", disabled, label, |
| 603 allowed); | 603 allowed); |
| 604 } | 604 } |
| 605 | 605 |
| 606 void LocalDiscoveryUIHandler::RefreshCloudPrintStatusFromService() { | 606 void LocalDiscoveryUIHandler::RefreshCloudPrintStatusFromService() { |
| 607 GetCloudPrintProxyService()->RefreshStatusFromService(); | 607 auto* service = GetCloudPrintProxyService(); |
| 608 if (service) |
| 609 service->RefreshStatusFromService(); |
| 608 } | 610 } |
| 609 | 611 |
| 610 CloudPrintProxyService* LocalDiscoveryUIHandler::GetCloudPrintProxyService() { | 612 CloudPrintProxyService* LocalDiscoveryUIHandler::GetCloudPrintProxyService() { |
| 611 return CloudPrintProxyServiceFactory::GetForProfile( | 613 return CloudPrintProxyServiceFactory::GetForProfile( |
| 612 Profile::FromWebUI(web_ui())); | 614 Profile::FromWebUI(web_ui())); |
| 613 } | 615 } |
| 614 #endif // defined(CLOUD_PRINT_CONNECTOR_UI_AVAILABLE) | 616 #endif // defined(CLOUD_PRINT_CONNECTOR_UI_AVAILABLE) |
| 615 | 617 |
| 616 } // namespace local_discovery | 618 } // namespace local_discovery |
| OLD | NEW |