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

Side by Side Diff: chrome/browser/ui/webui/engagement/site_engagement_ui_handler.cc

Issue 1316043003: Add chrome://site-engagement WebUI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@navigation_smarter
Patch Set: fix build more Created 5 years, 3 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
(Empty)
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
Sam McNally 2015/08/26 08:23:22 No (c)
calamity 2015/09/08 07:30:07 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/webui/engagement/site_engagement_ui_handler.h"
6
7 #include "chrome/browser/engagement/site_engagement_service.h"
8 #include "mojo/common/common_type_converters.h"
9 #include "url/gurl.h"
10
11 SiteEngagementUIHandler::SiteEngagementUIHandler(
12 Profile* profile,
13 mojo::InterfaceRequest<SiteEngagementUIHandlerMojo> request)
14 : profile_(profile), binding_(this, request.Pass()) {}
15
16 SiteEngagementUIHandler::~SiteEngagementUIHandler() {}
17
18 void SiteEngagementUIHandler::GetSiteEngagementInfo(
19 SiteEngagementPagePtr page) {
20 mojo::Array<SiteEngagementInfoPtr> engagement_info;
21
22 SiteEngagementService* service = SiteEngagementService::Get(profile_);
23 DCHECK(service);
24
25 for (auto info : service->GetScoreMap()) {
26 SiteEngagementInfoPtr origin_info(SiteEngagementInfo::New());
27 origin_info->origin = mojo::String::From(info.first.spec());
28 origin_info->score = info.second;
29 engagement_info.push_back(origin_info.Pass());
30 }
31
32 page->HandleSiteEngagementInfo(engagement_info.Pass());
33 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698