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

Side by Side Diff: components/ntp_snippets/content_suggestions_metrics.h

Issue 2609413005: [NTP::SectionOrder] Add category position metric for opened suggestions. (Closed)
Patch Set: added TODO. Created 3 years, 11 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_METRICS_H_ 5 #ifndef COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_METRICS_H_
6 #define COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_METRICS_H_ 6 #define COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_METRICS_H_
7 7
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/time/time.h" 11 #include "base/time/time.h"
12 #include "components/ntp_snippets/category.h" 12 #include "components/ntp_snippets/category.h"
13 #include "components/ntp_snippets/content_suggestions_service.h"
13 #include "ui/base/window_open_disposition.h" 14 #include "ui/base/window_open_disposition.h"
14 15
15 namespace ntp_snippets { 16 namespace ntp_snippets {
16 namespace metrics { 17 namespace metrics {
17 18
18 void OnPageShown( 19 void OnPageShown(
19 const std::vector<std::pair<Category, int>>& suggestions_per_category); 20 const std::vector<std::pair<Category, int>>& suggestions_per_category);
20 21
21 // Should only be called once per NTP for each suggestion. 22 // Should only be called once per NTP for each suggestion.
22 void OnSuggestionShown(int global_position, 23 void OnSuggestionShown(int global_position,
23 Category category, 24 Category category,
24 int category_position, 25 int position_in_category,
25 base::Time publish_date, 26 base::Time publish_date,
26 base::Time last_background_fetch_time, 27 base::Time last_background_fetch_time,
27 float score); 28 float score);
28 29
29 void OnSuggestionOpened(int global_position, 30 void OnSuggestionOpened(const ContentSuggestionsService* service,
31 int global_position,
30 Category category, 32 Category category,
31 int category_position, 33 int position_in_category,
32 base::Time publish_date, 34 base::Time publish_date,
33 float score, 35 float score,
34 WindowOpenDisposition disposition); 36 WindowOpenDisposition disposition);
35 37
36 void OnSuggestionMenuOpened(int global_position, 38 void OnSuggestionMenuOpened(int global_position,
37 Category category, 39 Category category,
38 int category_position, 40 int position_in_category,
39 base::Time publish_date, 41 base::Time publish_date,
40 float score); 42 float score);
41 43
42 void OnSuggestionDismissed(int global_position, 44 void OnSuggestionDismissed(int global_position,
43 Category category, 45 Category category,
44 int category_position, 46 int position_in_category,
45 bool visited); 47 bool visited);
46 48
47 void OnSuggestionTargetVisited(Category category, base::TimeDelta visit_time); 49 void OnSuggestionTargetVisited(Category category, base::TimeDelta visit_time);
48 50
49 // Should only be called once per NTP for each "more" button. 51 // Should only be called once per NTP for each "more" button.
50 void OnMoreButtonShown(Category category, int position); 52 void OnMoreButtonShown(Category category, int position);
51 53
52 void OnMoreButtonClicked(Category category, int position); 54 void OnMoreButtonClicked(Category category, int position);
53 55
54 void OnCategoryDismissed(Category category); 56 void OnCategoryDismissed(Category category);
55 57
56 } // namespace metrics 58 } // namespace metrics
57 } // namespace ntp_snippets 59 } // namespace ntp_snippets
58 60
59 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_SERVICE_H_ 61 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698