Chromium Code Reviews| Index: chrome/browser/ui/search/search_tab_helper.cc |
| diff --git a/chrome/browser/ui/search/search_tab_helper.cc b/chrome/browser/ui/search/search_tab_helper.cc |
| index b90872377821f778acb68b52b954ad61ec98f969..2fe2a7da4a418f104af1dc21c0a68136c1686d2b 100644 |
| --- a/chrome/browser/ui/search/search_tab_helper.cc |
| +++ b/chrome/browser/ui/search/search_tab_helper.cc |
| @@ -397,6 +397,24 @@ void SearchTabHelper::MostVisitedItemsChanged( |
| // our metrics get inconsistent. So we'd rather emit stats now. |
| InstantTab::EmitNtpStatistics(web_contents_); |
| ipc_router_.SendMostVisitedItems(items); |
| + this->LogMostVisitedItemsSource(items); |
|
fserb
2015/10/13 14:34:40
no need for "this->" here.
zmin
2015/10/13 15:08:38
Done.
|
| +} |
| + |
| +void SearchTabHelper::LogMostVisitedItemsSource( |
| + const std::vector<InstantMostVisitedItem>& items) { |
| + NTPLoggingEventType event; |
|
fserb
2015/10/13 14:34:40
you can move it inside the for().
zmin
2015/10/13 15:08:38
Talk with @fserb. Moving event and time into the f
|
| + base::TimeDelta time = base::TimeDelta(); |
|
fserb
2015/10/13 14:34:40
you can just pass 0 as time. I'm not even sure thi
zmin
2015/10/13 15:08:38
Talk with @fserb, 0 is the default value of TimeDe
|
| + for (auto item : items) { |
| + if (item.is_server_side_suggestion) { |
| + event = NTP_SERVER_SIDE_SUGGESTION; |
| + } else { |
| + event = NTP_CLIENT_SIDE_SUGGESTION; |
| + } |
| + // Note that the ntp_user_data_logger.cc now only supports the scenario: |
| + // all suggestions are provided by server OR |
| + // all suggestions are provided by client |
|
fserb
2015/10/13 14:34:40
nit: "." at the end of the comment.
zmin
2015/10/13 15:08:38
Done.
|
| + this->OnLogEvent(event, time); |
| + } |
| } |
| void SearchTabHelper::OmniboxStartMarginChanged(int omnibox_start_margin) { |