| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/domain_reliability_internals_ui.h" | 5 #include "chrome/browser/ui/webui/domain_reliability_internals_ui.h" |
| 6 | 6 |
| 7 #include "chrome/browser/domain_reliability/service_factory.h" | 7 #include "chrome/browser/domain_reliability/service_factory.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/common/url_constants.h" | 9 #include "chrome/common/url_constants.h" |
| 10 #include "components/domain_reliability/service.h" | 10 #include "components/domain_reliability/service.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 Profile* profile = Profile::FromWebUI(web_ui()); | 42 Profile* profile = Profile::FromWebUI(web_ui()); |
| 43 DomainReliabilityServiceFactory* factory = | 43 DomainReliabilityServiceFactory* factory = |
| 44 DomainReliabilityServiceFactory::GetInstance(); | 44 DomainReliabilityServiceFactory::GetInstance(); |
| 45 DCHECK(profile); | 45 DCHECK(profile); |
| 46 DCHECK(factory); | 46 DCHECK(factory); |
| 47 | 47 |
| 48 DomainReliabilityService* service = factory->GetForBrowserContext(profile); | 48 DomainReliabilityService* service = factory->GetForBrowserContext(profile); |
| 49 if (!service) { | 49 if (!service) { |
| 50 base::DictionaryValue* data = new base::DictionaryValue(); | 50 base::DictionaryValue* data = new base::DictionaryValue(); |
| 51 data->SetString("error", "no_service"); | 51 data->SetString("error", "no_service"); |
| 52 OnDataUpdated(scoped_ptr<base::Value>(data)); | 52 OnDataUpdated(std::unique_ptr<base::Value>(data)); |
| 53 return; | 53 return; |
| 54 } | 54 } |
| 55 | 55 |
| 56 service->GetWebUIData(base::Bind( | 56 service->GetWebUIData(base::Bind( |
| 57 &DomainReliabilityInternalsUI::OnDataUpdated, | 57 &DomainReliabilityInternalsUI::OnDataUpdated, |
| 58 base::Unretained(this))); | 58 base::Unretained(this))); |
| 59 } | 59 } |
| 60 | 60 |
| 61 void DomainReliabilityInternalsUI::OnDataUpdated( | 61 void DomainReliabilityInternalsUI::OnDataUpdated( |
| 62 scoped_ptr<base::Value> data) const { | 62 std::unique_ptr<base::Value> data) const { |
| 63 web_ui()->CallJavascriptFunction( | 63 web_ui()->CallJavascriptFunction( |
| 64 "DomainReliabilityInternals.onDataUpdated", *data); | 64 "DomainReliabilityInternals.onDataUpdated", *data); |
| 65 } | 65 } |
| OLD | NEW |