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

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

Issue 17526008: Log NTP hovers in 1993 clients (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 7 years, 5 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/instant_controller.h" 5 #include "chrome/browser/ui/search/instant_controller.h"
6 6
7 #include <iterator> 7 #include <iterator>
8 8
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after
1032 ResetInstantTab(); 1032 ResetInstantTab();
1033 } 1033 }
1034 1034
1035 void InstantController::TabDeactivated(content::WebContents* contents) { 1035 void InstantController::TabDeactivated(content::WebContents* contents) {
1036 LOG_INSTANT_DEBUG_EVENT(this, "TabDeactivated"); 1036 LOG_INSTANT_DEBUG_EVENT(this, "TabDeactivated");
1037 if (extended_enabled() && !contents->IsBeingDestroyed()) 1037 if (extended_enabled() && !contents->IsBeingDestroyed())
1038 CommitIfPossible(INSTANT_COMMIT_FOCUS_LOST); 1038 CommitIfPossible(INSTANT_COMMIT_FOCUS_LOST);
1039 1039
1040 if (GetOverlayContents()) 1040 if (GetOverlayContents())
1041 HideOverlay(); 1041 HideOverlay();
1042
1043 // If user is deactivating an NTP tab, log the number of mouseovers for this
1044 // NTP session.
1045 if (chrome::IsInstantNTP(contents))
1046 InstantNTP::EmitMouseoverCount(contents);
1042 } 1047 }
1043 1048
1044 void InstantController::SetInstantEnabled(bool instant_enabled, 1049 void InstantController::SetInstantEnabled(bool instant_enabled,
1045 bool use_local_page_only) { 1050 bool use_local_page_only) {
1046 LOG_INSTANT_DEBUG_EVENT(this, base::StringPrintf( 1051 LOG_INSTANT_DEBUG_EVENT(this, base::StringPrintf(
1047 "SetInstantEnabled: instant_enabled=%d, use_local_page_only=%d", 1052 "SetInstantEnabled: instant_enabled=%d, use_local_page_only=%d",
1048 instant_enabled, use_local_page_only)); 1053 instant_enabled, use_local_page_only));
1049 1054
1050 // Non extended mode does not care about |use_local_page_only|. 1055 // Non extended mode does not care about |use_local_page_only|.
1051 if (instant_enabled == instant_enabled_ && 1056 if (instant_enabled == instant_enabled_ &&
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after
1911 1916
1912 bool InstantController::InStartup() const { 1917 bool InstantController::InStartup() const {
1913 // TODO(shishir): This is not completely reliable. Find a better way to detect 1918 // TODO(shishir): This is not completely reliable. Find a better way to detect
1914 // startup time. 1919 // startup time.
1915 return !browser_->GetActiveWebContents(); 1920 return !browser_->GetActiveWebContents();
1916 } 1921 }
1917 1922
1918 InstantService* InstantController::GetInstantService() const { 1923 InstantService* InstantController::GetInstantService() const {
1919 return InstantServiceFactory::GetForProfile(profile()); 1924 return InstantServiceFactory::GetForProfile(profile());
1920 } 1925 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698