| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/search/search_ipc_router.h" | 5 #include "chrome/browser/ui/search/search_ipc_router.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/search/search.h" | 10 #include "chrome/browser/search/search.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 return; | 209 return; |
| 210 | 210 |
| 211 delegate_->OnInstantSupportDetermined(true); | 211 delegate_->OnInstantSupportDetermined(true); |
| 212 if (!policy_->ShouldProcessLogEvent()) | 212 if (!policy_->ShouldProcessLogEvent()) |
| 213 return; | 213 return; |
| 214 | 214 |
| 215 delegate_->OnLogEvent(event, time); | 215 delegate_->OnLogEvent(event, time); |
| 216 } | 216 } |
| 217 | 217 |
| 218 void SearchIPCRouter::OnLogMostVisitedImpression( | 218 void SearchIPCRouter::OnLogMostVisitedImpression( |
| 219 int page_seq_no, int position, NTPLoggingTileSource tile_source) const { | 219 int page_seq_no, |
| 220 int position, |
| 221 ntp_tiles::NTPTileSource tile_source) const { |
| 220 if (page_seq_no != commit_counter_) | 222 if (page_seq_no != commit_counter_) |
| 221 return; | 223 return; |
| 222 | 224 |
| 223 delegate_->OnInstantSupportDetermined(true); | 225 delegate_->OnInstantSupportDetermined(true); |
| 224 // Logging impressions is controlled by the same policy as logging events. | 226 // Logging impressions is controlled by the same policy as logging events. |
| 225 if (!policy_->ShouldProcessLogEvent()) | 227 if (!policy_->ShouldProcessLogEvent()) |
| 226 return; | 228 return; |
| 227 | 229 |
| 228 delegate_->OnLogMostVisitedImpression(position, tile_source); | 230 delegate_->OnLogMostVisitedImpression(position, tile_source); |
| 229 } | 231 } |
| 230 | 232 |
| 231 void SearchIPCRouter::OnLogMostVisitedNavigation( | 233 void SearchIPCRouter::OnLogMostVisitedNavigation( |
| 232 int page_seq_no, int position, NTPLoggingTileSource tile_source) const { | 234 int page_seq_no, |
| 235 int position, |
| 236 ntp_tiles::NTPTileSource tile_source) const { |
| 233 if (page_seq_no != commit_counter_) | 237 if (page_seq_no != commit_counter_) |
| 234 return; | 238 return; |
| 235 | 239 |
| 236 delegate_->OnInstantSupportDetermined(true); | 240 delegate_->OnInstantSupportDetermined(true); |
| 237 // Logging navigations is controlled by the same policy as logging events. | 241 // Logging navigations is controlled by the same policy as logging events. |
| 238 if (!policy_->ShouldProcessLogEvent()) | 242 if (!policy_->ShouldProcessLogEvent()) |
| 239 return; | 243 return; |
| 240 | 244 |
| 241 delegate_->OnLogMostVisitedNavigation(position, tile_source); | 245 delegate_->OnLogMostVisitedNavigation(position, tile_source); |
| 242 } | 246 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 | 283 |
| 280 void SearchIPCRouter::set_delegate_for_testing(Delegate* delegate) { | 284 void SearchIPCRouter::set_delegate_for_testing(Delegate* delegate) { |
| 281 DCHECK(delegate); | 285 DCHECK(delegate); |
| 282 delegate_ = delegate; | 286 delegate_ = delegate; |
| 283 } | 287 } |
| 284 | 288 |
| 285 void SearchIPCRouter::set_policy_for_testing(std::unique_ptr<Policy> policy) { | 289 void SearchIPCRouter::set_policy_for_testing(std::unique_ptr<Policy> policy) { |
| 286 DCHECK(policy); | 290 DCHECK(policy); |
| 287 policy_ = std::move(policy); | 291 policy_ = std::move(policy); |
| 288 } | 292 } |
| OLD | NEW |