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

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

Issue 2735333002: Rename SiteEngagementService::ResetScoreForURL. (Closed)
Patch Set: Created 3 years, 9 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 | « chrome/browser/push_messaging/push_messaging_browsertest.cc ('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 <cmath> 7 #include <cmath>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 } 55 }
56 56
57 void SetSiteEngagementScoreForOrigin(const GURL& origin, 57 void SetSiteEngagementScoreForOrigin(const GURL& origin,
58 double score) override { 58 double score) override {
59 if (!origin.is_valid() || score < 0 || 59 if (!origin.is_valid() || score < 0 ||
60 score > SiteEngagementService::GetMaxPoints() || std::isnan(score)) { 60 score > SiteEngagementService::GetMaxPoints() || std::isnan(score)) {
61 return; 61 return;
62 } 62 }
63 63
64 SiteEngagementService* service = SiteEngagementService::Get(profile_); 64 SiteEngagementService* service = SiteEngagementService::Get(profile_);
65 service->ResetScoreForURL(origin, score); 65 service->ResetBaseScoreForURL(origin, score);
66 } 66 }
67 67
68 private: 68 private:
69 // The Profile* handed to us in our constructor. 69 // The Profile* handed to us in our constructor.
70 Profile* profile_; 70 Profile* profile_;
71 71
72 mojo::Binding<mojom::SiteEngagementUIHandler> binding_; 72 mojo::Binding<mojom::SiteEngagementUIHandler> binding_;
73 73
74 DISALLOW_COPY_AND_ASSIGN(SiteEngagementUIHandlerImpl); 74 DISALLOW_COPY_AND_ASSIGN(SiteEngagementUIHandlerImpl);
75 }; 75 };
(...skipping 15 matching lines...) Expand all
91 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), source.release()); 91 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), source.release());
92 } 92 }
93 93
94 SiteEngagementUI::~SiteEngagementUI() {} 94 SiteEngagementUI::~SiteEngagementUI() {}
95 95
96 void SiteEngagementUI::BindUIHandler( 96 void SiteEngagementUI::BindUIHandler(
97 mojo::InterfaceRequest<mojom::SiteEngagementUIHandler> request) { 97 mojo::InterfaceRequest<mojom::SiteEngagementUIHandler> request) {
98 ui_handler_.reset(new SiteEngagementUIHandlerImpl( 98 ui_handler_.reset(new SiteEngagementUIHandlerImpl(
99 Profile::FromWebUI(web_ui()), std::move(request))); 99 Profile::FromWebUI(web_ui()), std::move(request)));
100 } 100 }
OLDNEW
« no previous file with comments | « chrome/browser/push_messaging/push_messaging_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698