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

Side by Side Diff: chrome/browser/instant/promo_counter.cc

Issue 5606002: Move:... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years 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/instant/instant_loader.cc ('k') | chrome/browser/intranet_redirect_detector.cc » ('j') | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/instant/promo_counter.h" 5 #include "chrome/browser/instant/promo_counter.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/prefs/pref_service.h" 9 #include "chrome/browser/prefs/pref_service.h"
10 #include "chrome/browser/profile.h" 10 #include "chrome/browser/profiles/profile.h"
11 11
12 // Pref keys. These are relative to pref_key_. 12 // Pref keys. These are relative to pref_key_.
13 static const char* kShowKey = ".show"; 13 static const char* kShowKey = ".show";
14 static const char* kNumSessionsKey = ".num_sessions"; 14 static const char* kNumSessionsKey = ".num_sessions";
15 static const char* kInitialTimeKey = ".initial_time"; 15 static const char* kInitialTimeKey = ".initial_time";
16 16
17 // Values used for histograms. These are relative to histogram_key_. 17 // Values used for histograms. These are relative to histogram_key_.
18 static const char* kHistogramHide = ".hide"; 18 static const char* kHistogramHide = ".hide";
19 static const char* kHistogramMaxSessions = ".max_sessions"; 19 static const char* kHistogramMaxSessions = ".max_sessions";
20 static const char* kHistogramMaxTime = ".max_time"; 20 static const char* kHistogramMaxTime = ".max_time";
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 } 106 }
107 107
108 void PromoCounter::MaxTimeLapsed(base::Time current_time) { 108 void PromoCounter::MaxTimeLapsed(base::Time current_time) {
109 show_ = false; 109 show_ = false;
110 UMA_HISTOGRAM_CUSTOM_COUNTS(histogram_key_ + kHistogramMaxTime, 110 UMA_HISTOGRAM_CUSTOM_COUNTS(histogram_key_ + kHistogramMaxTime,
111 (current_time - initial_show_).InHours(), 111 (current_time - initial_show_).InHours(),
112 1, max_days_ * 24, 24); 112 1, max_days_ * 24, 24);
113 if (profile_->GetPrefs()) 113 if (profile_->GetPrefs())
114 profile_->GetPrefs()->SetBoolean((pref_key_ + kShowKey).c_str(), false); 114 profile_->GetPrefs()->SetBoolean((pref_key_ + kShowKey).c_str(), false);
115 } 115 }
OLDNEW
« no previous file with comments | « chrome/browser/instant/instant_loader.cc ('k') | chrome/browser/intranet_redirect_detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698