Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "ui/base/window_open_disposition.h" | 13 #include "ui/base/window_open_disposition.h" |
| 14 | 14 |
| 15 namespace ntp_snippets { | 15 namespace ntp_snippets { |
| 16 namespace metrics { | 16 namespace metrics { |
| 17 | 17 |
| 18 void OnPageShown( | 18 void OnPageShown( |
| 19 const std::vector<std::pair<Category, int>>& suggestions_per_category); | 19 const std::vector<std::pair<Category, int>>& suggestions_per_category); |
| 20 | 20 |
| 21 // Should only be called once per NTP for each suggestion. | 21 // Should only be called once per NTP for each suggestion. |
| 22 void OnSuggestionShown(int global_position, | 22 void OnSuggestionShown(int global_position, |
| 23 Category category, | 23 Category category, |
| 24 int category_position, | 24 int position_in_category, |
| 25 base::Time publish_date, | 25 base::Time publish_date, |
| 26 base::Time last_background_fetch_time, | 26 base::Time last_background_fetch_time, |
| 27 float score); | 27 float score); |
|
Marc Treib
2017/01/16 10:45:42
Hm. I'm wondering whether we should pack most of t
tschumann
2017/01/16 11:02:22
Seems like a good idea. However, I'd be in favor o
Marc Treib
2017/01/16 11:18:54
Oh, absolutely! I was thinking global_position, ca
vitaliii
2017/01/18 09:19:20
I agree, I added a TODO and crbug.com/682160.
| |
| 28 | 28 |
| 29 void OnSuggestionOpened(int global_position, | 29 void OnSuggestionOpened(int global_position, |
| 30 Category category, | 30 Category category, |
| 31 int category_position, | 31 int category_rank, |
| 32 int position_in_category, | |
| 32 base::Time publish_date, | 33 base::Time publish_date, |
| 33 float score, | 34 float score, |
| 34 WindowOpenDisposition disposition); | 35 WindowOpenDisposition disposition); |
| 35 | 36 |
| 36 void OnSuggestionMenuOpened(int global_position, | 37 void OnSuggestionMenuOpened(int global_position, |
| 37 Category category, | 38 Category category, |
| 38 int category_position, | 39 int position_in_category, |
| 39 base::Time publish_date, | 40 base::Time publish_date, |
| 40 float score); | 41 float score); |
| 41 | 42 |
| 42 void OnSuggestionDismissed(int global_position, | 43 void OnSuggestionDismissed(int global_position, |
| 43 Category category, | 44 Category category, |
| 44 int category_position, | 45 int position_in_category, |
| 45 bool visited); | 46 bool visited); |
| 46 | 47 |
| 47 void OnSuggestionTargetVisited(Category category, base::TimeDelta visit_time); | 48 void OnSuggestionTargetVisited(Category category, base::TimeDelta visit_time); |
| 48 | 49 |
| 49 // Should only be called once per NTP for each "more" button. | 50 // Should only be called once per NTP for each "more" button. |
| 50 void OnMoreButtonShown(Category category, int position); | 51 void OnMoreButtonShown(Category category, int position); |
| 51 | 52 |
| 52 void OnMoreButtonClicked(Category category, int position); | 53 void OnMoreButtonClicked(Category category, int position); |
| 53 | 54 |
| 54 void OnCategoryDismissed(Category category); | 55 void OnCategoryDismissed(Category category); |
| 55 | 56 |
| 56 } // namespace metrics | 57 } // namespace metrics |
| 57 } // namespace ntp_snippets | 58 } // namespace ntp_snippets |
| 58 | 59 |
| 59 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_SERVICE_H_ | 60 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_SERVICE_H_ |
| OLD | NEW |