Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(294)

Side by Side Diff: chrome/browser/ui/search/search_tab_helper.cc

Issue 1006753003: Add time from navigation_start to NTP LogEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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,
482 base::TimeDelta time) {
482 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. 483 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef.
483 #if !defined(OS_ANDROID) 484 #if !defined(OS_ANDROID)
484 NTPUserDataLogger::GetOrCreateFromWebContents( 485 NTPUserDataLogger::GetOrCreateFromWebContents(web_contents())
485 web_contents())->LogEvent(event); 486 ->LogEvent(event, time);
486 #endif 487 #endif
487 } 488 }
488 489
489 void SearchTabHelper::OnLogMostVisitedImpression( 490 void SearchTabHelper::OnLogMostVisitedImpression(
490 int position, const base::string16& provider) { 491 int position, const base::string16& provider) {
491 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. 492 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef.
492 #if !defined(OS_ANDROID) 493 #if !defined(OS_ANDROID)
493 NTPUserDataLogger::GetOrCreateFromWebContents( 494 NTPUserDataLogger::GetOrCreateFromWebContents(
494 web_contents())->LogMostVisitedImpression(position, provider); 495 web_contents())->LogMostVisitedImpression(position, provider);
495 #endif 496 #endif
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 591
591 bool SearchTabHelper::IsInputInProgress() const { 592 bool SearchTabHelper::IsInputInProgress() const {
592 OmniboxView* omnibox = GetOmniboxView(); 593 OmniboxView* omnibox = GetOmniboxView();
593 return !model_.mode().is_ntp() && omnibox && 594 return !model_.mode().is_ntp() && omnibox &&
594 omnibox->model()->focus_state() == OMNIBOX_FOCUS_VISIBLE; 595 omnibox->model()->focus_state() == OMNIBOX_FOCUS_VISIBLE;
595 } 596 }
596 597
597 OmniboxView* SearchTabHelper::GetOmniboxView() const { 598 OmniboxView* SearchTabHelper::GetOmniboxView() const {
598 return delegate_ ? delegate_->GetOmniboxView() : NULL; 599 return delegate_ ? delegate_->GetOmniboxView() : NULL;
599 } 600 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/search/search_tab_helper.h ('k') | chrome/browser/ui/search/search_tab_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698