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

Side by Side Diff: chrome/browser/ui/webui/domain_reliability_internals_ui.cc

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 unified diff | Download patch
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/domain_reliability_internals_ui.h ('k') | chrome/browser/ui/webui/engagement/site_engagement_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698