OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_tab_helper.h" | 5 #include "chrome/browser/ui/search/search_tab_helper.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 DCHECK(!url.is_empty()); | 471 DCHECK(!url.is_empty()); |
472 if (instant_service_) | 472 if (instant_service_) |
473 instant_service_->UndoMostVisitedDeletion(url); | 473 instant_service_->UndoMostVisitedDeletion(url); |
474 } | 474 } |
475 | 475 |
476 void SearchTabHelper::OnUndoAllMostVisitedDeletions() { | 476 void SearchTabHelper::OnUndoAllMostVisitedDeletions() { |
477 if (instant_service_) | 477 if (instant_service_) |
478 instant_service_->UndoAllMostVisitedDeletions(); | 478 instant_service_->UndoAllMostVisitedDeletions(); |
479 } | 479 } |
480 | 480 |
481 void SearchTabHelper::OnLogEvent(NTPLoggingEventType event) { | 481 void SearchTabHelper::OnLogEvent(NTPLoggingEventType event, uint64 time) { |
482 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. | 482 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. |
483 #if !defined(OS_ANDROID) | 483 #if !defined(OS_ANDROID) |
484 NTPUserDataLogger::GetOrCreateFromWebContents( | 484 NTPUserDataLogger::GetOrCreateFromWebContents(web_contents()) |
485 web_contents())->LogEvent(event); | 485 ->LogEvent(event, time); |
486 #endif | 486 #endif |
487 } | 487 } |
488 | 488 |
489 void SearchTabHelper::OnLogMostVisitedImpression( | 489 void SearchTabHelper::OnLogMostVisitedImpression( |
490 int position, const base::string16& provider) { | 490 int position, const base::string16& provider) { |
491 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. | 491 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. |
492 #if !defined(OS_ANDROID) | 492 #if !defined(OS_ANDROID) |
493 NTPUserDataLogger::GetOrCreateFromWebContents( | 493 NTPUserDataLogger::GetOrCreateFromWebContents( |
494 web_contents())->LogMostVisitedImpression(position, provider); | 494 web_contents())->LogMostVisitedImpression(position, provider); |
495 #endif | 495 #endif |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 | 590 |
591 bool SearchTabHelper::IsInputInProgress() const { | 591 bool SearchTabHelper::IsInputInProgress() const { |
592 OmniboxView* omnibox = GetOmniboxView(); | 592 OmniboxView* omnibox = GetOmniboxView(); |
593 return !model_.mode().is_ntp() && omnibox && | 593 return !model_.mode().is_ntp() && omnibox && |
594 omnibox->model()->focus_state() == OMNIBOX_FOCUS_VISIBLE; | 594 omnibox->model()->focus_state() == OMNIBOX_FOCUS_VISIBLE; |
595 } | 595 } |
596 | 596 |
597 OmniboxView* SearchTabHelper::GetOmniboxView() const { | 597 OmniboxView* SearchTabHelper::GetOmniboxView() const { |
598 return delegate_ ? delegate_->GetOmniboxView() : NULL; | 598 return delegate_ ? delegate_->GetOmniboxView() : NULL; |
599 } | 599 } |
OLD | NEW |