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

Side by Side Diff: chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.cc

Issue 1928013003: Fix a crash in LocalDiscoveryUIHandler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698