diff options
author | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-06 20:19:29 +0000 |
---|---|---|
committer | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-06 20:19:29 +0000 |
commit | cd1c78349190f4084424fe9790f2548b0d52167a (patch) | |
tree | d2786ce9f424ddf04ebca6be6d3183bb3463c875 /chrome/browser/rlz/rlz.cc | |
parent | 0ef42ff9d9de850a881cfa66f96d4217695a2186 (diff) | |
download | chromium_src-cd1c78349190f4084424fe9790f2548b0d52167a.zip chromium_src-cd1c78349190f4084424fe9790f2548b0d52167a.tar.gz chromium_src-cd1c78349190f4084424fe9790f2548b0d52167a.tar.bz2 |
Add a ping delay time master preference.
BUG=1953127
Review URL: http://codereview.chromium.org/149135
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19978 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/rlz/rlz.cc')
-rw-r--r-- | chrome/browser/rlz/rlz.cc | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/chrome/browser/rlz/rlz.cc b/chrome/browser/rlz/rlz.cc index 96ea0c2..a280be2 100644 --- a/chrome/browser/rlz/rlz.cc +++ b/chrome/browser/rlz/rlz.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // @@ -287,13 +287,22 @@ bool RLZTracker::InitRlz(int directory_key) { return LoadRLZLibrary(directory_key); } -bool RLZTracker::InitRlzDelayed(int directory_key, bool first_run) { +bool RLZTracker::InitRlzDelayed(int directory_key, bool first_run, int delay) { + // Maximum and minimum delay we would allow to be set through master + // preferences. Somewhat arbitrary, may need to be adjusted in future. + const int kMaxDelay = 200 * 1000; + const int kMinDelay = 20 * 1000; + + delay *= 1000; + delay = (delay < kMinDelay) ? kMinDelay : delay; + delay = (delay > kMaxDelay) ? kMaxDelay : delay; + if (!OmniBoxUsageObserver::used()) new OmniBoxUsageObserver(); + // Schedule the delayed init items. - const int kNinetySeconds = 90 * 1000; MessageLoop::current()->PostDelayedTask(FROM_HERE, - new DelayedInitTask(directory_key, first_run), kNinetySeconds); + new DelayedInitTask(directory_key, first_run), delay); return true; } |