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/instant_service.h" | 10 #include "chrome/browser/search/instant_service.h" |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 delegate_->OnInstantSupportDetermined(true); | 244 delegate_->OnInstantSupportDetermined(true); |
245 if (!policy_->ShouldProcessLogEvent()) | 245 if (!policy_->ShouldProcessLogEvent()) |
246 return; | 246 return; |
247 | 247 |
248 delegate_->OnLogEvent(event, time); | 248 delegate_->OnLogEvent(event, time); |
249 } | 249 } |
250 | 250 |
251 void SearchIPCRouter::LogMostVisitedImpression( | 251 void SearchIPCRouter::LogMostVisitedImpression( |
252 int page_seq_no, | 252 int page_seq_no, |
253 int position, | 253 int position, |
254 ntp_tiles::TileSource tile_source) { | 254 ntp_tiles::TileSource tile_source, |
| 255 ntp_tiles::TileVisualType tile_type) { |
255 if (page_seq_no != commit_counter_) | 256 if (page_seq_no != commit_counter_) |
256 return; | 257 return; |
257 | 258 |
258 delegate_->OnInstantSupportDetermined(true); | 259 delegate_->OnInstantSupportDetermined(true); |
259 // Logging impressions is controlled by the same policy as logging events. | 260 // Logging impressions is controlled by the same policy as logging events. |
260 if (!policy_->ShouldProcessLogEvent()) | 261 if (!policy_->ShouldProcessLogEvent()) |
261 return; | 262 return; |
262 | 263 |
263 delegate_->OnLogMostVisitedImpression(position, tile_source); | 264 delegate_->OnLogMostVisitedImpression(position, tile_source, tile_type); |
264 } | 265 } |
265 | 266 |
266 void SearchIPCRouter::LogMostVisitedNavigation( | 267 void SearchIPCRouter::LogMostVisitedNavigation( |
267 int page_seq_no, | 268 int page_seq_no, |
268 int position, | 269 int position, |
269 ntp_tiles::TileSource tile_source) { | 270 ntp_tiles::TileSource tile_source, |
| 271 ntp_tiles::TileVisualType tile_type) { |
270 if (page_seq_no != commit_counter_) | 272 if (page_seq_no != commit_counter_) |
271 return; | 273 return; |
272 | 274 |
273 delegate_->OnInstantSupportDetermined(true); | 275 delegate_->OnInstantSupportDetermined(true); |
274 // Logging navigations is controlled by the same policy as logging events. | 276 // Logging navigations is controlled by the same policy as logging events. |
275 if (!policy_->ShouldProcessLogEvent()) | 277 if (!policy_->ShouldProcessLogEvent()) |
276 return; | 278 return; |
277 | 279 |
278 delegate_->OnLogMostVisitedNavigation(position, tile_source); | 280 delegate_->OnLogMostVisitedNavigation(position, tile_source, tile_type); |
279 } | 281 } |
280 | 282 |
281 void SearchIPCRouter::PasteAndOpenDropdown(int page_seq_no, | 283 void SearchIPCRouter::PasteAndOpenDropdown(int page_seq_no, |
282 const base::string16& text) { | 284 const base::string16& text) { |
283 if (page_seq_no != commit_counter_) | 285 if (page_seq_no != commit_counter_) |
284 return; | 286 return; |
285 | 287 |
286 delegate_->OnInstantSupportDetermined(true); | 288 delegate_->OnInstantSupportDetermined(true); |
287 if (!policy_->ShouldProcessPasteIntoOmnibox(is_active_tab_)) | 289 if (!policy_->ShouldProcessPasteIntoOmnibox(is_active_tab_)) |
288 return; | 290 return; |
(...skipping 26 matching lines...) Expand all Loading... |
315 | 317 |
316 void SearchIPCRouter::set_delegate_for_testing(Delegate* delegate) { | 318 void SearchIPCRouter::set_delegate_for_testing(Delegate* delegate) { |
317 DCHECK(delegate); | 319 DCHECK(delegate); |
318 delegate_ = delegate; | 320 delegate_ = delegate; |
319 } | 321 } |
320 | 322 |
321 void SearchIPCRouter::set_policy_for_testing(std::unique_ptr<Policy> policy) { | 323 void SearchIPCRouter::set_policy_for_testing(std::unique_ptr<Policy> policy) { |
322 DCHECK(policy); | 324 DCHECK(policy); |
323 policy_ = std::move(policy); | 325 policy_ = std::move(policy); |
324 } | 326 } |
OLD | NEW |