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

Side by Side Diff: chrome/browser/prerender/prerender_tab_helper.cc

Issue 21948003: Add instrumentation to detect the type of login actions being added. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/prerender/prerender_tab_helper.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/prerender/prerender_tab_helper.h" 5 #include "chrome/browser/prerender/prerender_tab_helper.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "chrome/browser/predictors/logged_in_predictor_table.h" 10 #include "chrome/browser/predictors/logged_in_predictor_table.h"
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 } 243 }
244 } 244 }
245 245
246 void PrerenderTabHelper::DidNavigateAnyFrame( 246 void PrerenderTabHelper::DidNavigateAnyFrame(
247 const content::LoadCommittedDetails& details, 247 const content::LoadCommittedDetails& details,
248 const content::FrameNavigateParams& params) { 248 const content::FrameNavigateParams& params) {
249 PrerenderManager* prerender_manager = MaybeGetPrerenderManager(); 249 PrerenderManager* prerender_manager = MaybeGetPrerenderManager();
250 if (params.password_form.origin.is_valid() && prerender_manager) { 250 if (params.password_form.origin.is_valid() && prerender_manager) {
251 prerender_manager->RecordLikelyLoginOnURL(params.url); 251 prerender_manager->RecordLikelyLoginOnURL(params.url);
252 RecordEvent(EVENT_LOGIN_ACTION_ADDED); 252 RecordEvent(EVENT_LOGIN_ACTION_ADDED);
253 if (details.is_main_frame) {
254 RecordEvent(EVENT_LOGIN_ACTION_ADDED_MAINFRAME);
255 if (params.password_form.password_value.empty())
256 RecordEvent(EVENT_LOGIN_ACTION_ADDED_MAINFRAME_PW_EMPTY);
257 } else {
258 RecordEvent(EVENT_LOGIN_ACTION_ADDED_SUBFRAME);
259 if (params.password_form.password_value.empty())
260 RecordEvent(EVENT_LOGIN_ACTION_ADDED_SUBFRAME_PW_EMPTY);
261 }
253 } 262 }
254 } 263 }
255 264
256 PrerenderManager* PrerenderTabHelper::MaybeGetPrerenderManager() const { 265 PrerenderManager* PrerenderTabHelper::MaybeGetPrerenderManager() const {
257 return PrerenderManagerFactory::GetForProfile( 266 return PrerenderManagerFactory::GetForProfile(
258 Profile::FromBrowserContext(web_contents()->GetBrowserContext())); 267 Profile::FromBrowserContext(web_contents()->GetBrowserContext()));
259 } 268 }
260 269
261 bool PrerenderTabHelper::IsPrerendering() { 270 bool PrerenderTabHelper::IsPrerendering() {
262 PrerenderManager* prerender_manager = MaybeGetPrerenderManager(); 271 PrerenderManager* prerender_manager = MaybeGetPrerenderManager();
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 328
320 void PrerenderTabHelper::RecordEventIfLoggedInURLResult( 329 void PrerenderTabHelper::RecordEventIfLoggedInURLResult(
321 PrerenderTabHelper::Event event, 330 PrerenderTabHelper::Event event,
322 scoped_ptr<bool> is_present, 331 scoped_ptr<bool> is_present,
323 scoped_ptr<bool> lookup_succeeded) { 332 scoped_ptr<bool> lookup_succeeded) {
324 if (*lookup_succeeded && *is_present) 333 if (*lookup_succeeded && *is_present)
325 RecordEvent(event); 334 RecordEvent(event);
326 } 335 }
327 336
328 } // namespace prerender 337 } // namespace prerender
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_tab_helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698