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

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

Issue 1407363010: Make table in chrome:site-engagement sortable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: go back to normal functions to please the almighty PRESUBMIT Created 5 years, 1 month 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 | « chrome/browser/ui/webui/engagement/site_engagement.mojom ('k') | 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/engagement/site_engagement_ui.h" 5 #include "chrome/browser/ui/webui/engagement/site_engagement_ui.h"
6 6
7 #include "chrome/browser/engagement/site_engagement_service.h" 7 #include "chrome/browser/engagement/site_engagement_service.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 "content/public/browser/web_ui.h" 10 #include "content/public/browser/web_ui.h"
(...skipping 19 matching lines...) Expand all
30 30
31 ~SiteEngagementUIHandlerImpl() override {} 31 ~SiteEngagementUIHandlerImpl() override {}
32 32
33 // SiteEngagementUIHandler overrides: 33 // SiteEngagementUIHandler overrides:
34 void GetSiteEngagementInfo( 34 void GetSiteEngagementInfo(
35 const GetSiteEngagementInfoCallback& callback) override { 35 const GetSiteEngagementInfoCallback& callback) override {
36 mojo::Array<SiteEngagementInfoPtr> engagement_info(0); 36 mojo::Array<SiteEngagementInfoPtr> engagement_info(0);
37 37
38 SiteEngagementService* service = SiteEngagementService::Get(profile_); 38 SiteEngagementService* service = SiteEngagementService::Get(profile_);
39 39
40 for (const std::pair<GURL, int>& info : service->GetScoreMap()) { 40 for (const std::pair<GURL, double>& info : service->GetScoreMap()) {
41 SiteEngagementInfoPtr origin_info(SiteEngagementInfo::New()); 41 SiteEngagementInfoPtr origin_info(SiteEngagementInfo::New());
42 origin_info->origin = mojo::String::From(info.first); 42 origin_info->origin = mojo::String::From(info.first);
43 origin_info->score = info.second; 43 origin_info->score = info.second;
44 engagement_info.push_back(origin_info.Pass()); 44 engagement_info.push_back(origin_info.Pass());
45 } 45 }
46 46
47 callback.Run(engagement_info.Pass()); 47 callback.Run(engagement_info.Pass());
48 } 48 }
49 49
50 private: 50 private:
(...skipping 28 matching lines...) Expand all
79 IDR_SITE_ENGAGEMENT_MOJO_JS); 79 IDR_SITE_ENGAGEMENT_MOJO_JS);
80 } 80 }
81 81
82 SiteEngagementUI::~SiteEngagementUI() {} 82 SiteEngagementUI::~SiteEngagementUI() {}
83 83
84 void SiteEngagementUI::BindUIHandler( 84 void SiteEngagementUI::BindUIHandler(
85 mojo::InterfaceRequest<SiteEngagementUIHandler> request) { 85 mojo::InterfaceRequest<SiteEngagementUIHandler> request) {
86 // SiteEngagementUIHandlerImpl deletes itself when the pipe is closed. 86 // SiteEngagementUIHandlerImpl deletes itself when the pipe is closed.
87 new SiteEngagementUIHandlerImpl(Profile::FromWebUI(web_ui()), request.Pass()); 87 new SiteEngagementUIHandlerImpl(Profile::FromWebUI(web_ui()), request.Pass());
88 } 88 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/engagement/site_engagement.mojom ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698