| 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 "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "chrome/browser/search/search.h" | 8 #include "chrome/browser/search/search.h" |
| 9 #include "chrome/common/render_messages.h" | 9 #include "chrome/common/render_messages.h" |
| 10 #include "content/public/browser/navigation_details.h" | 10 #include "content/public/browser/navigation_details.h" |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 return; | 276 return; |
| 277 | 277 |
| 278 delegate_->OnInstantSupportDetermined(true); | 278 delegate_->OnInstantSupportDetermined(true); |
| 279 if (!policy_->ShouldProcessUndoAllMostVisitedDeletions()) | 279 if (!policy_->ShouldProcessUndoAllMostVisitedDeletions()) |
| 280 return; | 280 return; |
| 281 | 281 |
| 282 delegate_->OnUndoAllMostVisitedDeletions(); | 282 delegate_->OnUndoAllMostVisitedDeletions(); |
| 283 } | 283 } |
| 284 | 284 |
| 285 void SearchIPCRouter::OnLogEvent(int page_seq_no, | 285 void SearchIPCRouter::OnLogEvent(int page_seq_no, |
| 286 NTPLoggingEventType event) const { | 286 NTPLoggingEventType event, |
| 287 uint64 time) const { |
| 287 if (page_seq_no != commit_counter_) | 288 if (page_seq_no != commit_counter_) |
| 288 return; | 289 return; |
| 289 | 290 |
| 290 delegate_->OnInstantSupportDetermined(true); | 291 delegate_->OnInstantSupportDetermined(true); |
| 291 if (!policy_->ShouldProcessLogEvent()) | 292 if (!policy_->ShouldProcessLogEvent()) |
| 292 return; | 293 return; |
| 293 | 294 |
| 294 delegate_->OnLogEvent(event); | 295 delegate_->OnLogEvent(event, time); |
| 295 } | 296 } |
| 296 | 297 |
| 297 void SearchIPCRouter::OnLogMostVisitedImpression( | 298 void SearchIPCRouter::OnLogMostVisitedImpression( |
| 298 int page_seq_no, int position, const base::string16& provider) const { | 299 int page_seq_no, int position, const base::string16& provider) const { |
| 299 if (page_seq_no != commit_counter_ || !IsProviderValid(provider)) | 300 if (page_seq_no != commit_counter_ || !IsProviderValid(provider)) |
| 300 return; | 301 return; |
| 301 | 302 |
| 302 delegate_->OnInstantSupportDetermined(true); | 303 delegate_->OnInstantSupportDetermined(true); |
| 303 // Logging impressions is controlled by the same policy as logging events. | 304 // Logging impressions is controlled by the same policy as logging events. |
| 304 if (!policy_->ShouldProcessLogEvent()) | 305 if (!policy_->ShouldProcessLogEvent()) |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 | 359 |
| 359 void SearchIPCRouter::set_delegate_for_testing(Delegate* delegate) { | 360 void SearchIPCRouter::set_delegate_for_testing(Delegate* delegate) { |
| 360 DCHECK(delegate); | 361 DCHECK(delegate); |
| 361 delegate_ = delegate; | 362 delegate_ = delegate; |
| 362 } | 363 } |
| 363 | 364 |
| 364 void SearchIPCRouter::set_policy_for_testing(scoped_ptr<Policy> policy) { | 365 void SearchIPCRouter::set_policy_for_testing(scoped_ptr<Policy> policy) { |
| 365 DCHECK(policy.get()); | 366 DCHECK(policy.get()); |
| 366 policy_.reset(policy.release()); | 367 policy_.reset(policy.release()); |
| 367 } | 368 } |
| OLD | NEW |