| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // This code glues the RLZ library DLL with Chrome. It allows Chrome to work | 5 // This code glues the RLZ library DLL with Chrome. It allows Chrome to work |
| 6 // with or without the DLL being present. If the DLL is not present the | 6 // with or without the DLL being present. If the DLL is not present the |
| 7 // functions do nothing and just return false. | 7 // functions do nothing and just return false. |
| 8 | 8 |
| 9 #include "chrome/browser/rlz/rlz.h" | 9 #include "chrome/browser/rlz/rlz.h" |
| 10 | 10 |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 } // namespace | 285 } // namespace |
| 286 | 286 |
| 287 bool RLZTracker::InitRlz(int directory_key) { | 287 bool RLZTracker::InitRlz(int directory_key) { |
| 288 return LoadRLZLibrary(directory_key); | 288 return LoadRLZLibrary(directory_key); |
| 289 } | 289 } |
| 290 | 290 |
| 291 bool RLZTracker::InitRlzDelayed(int directory_key, bool first_run) { | 291 bool RLZTracker::InitRlzDelayed(int directory_key, bool first_run) { |
| 292 if (!OmniBoxUsageObserver::used()) | 292 if (!OmniBoxUsageObserver::used()) |
| 293 new OmniBoxUsageObserver(); | 293 new OmniBoxUsageObserver(); |
| 294 // Schedule the delayed init items. | 294 // Schedule the delayed init items. |
| 295 const int kTwentySeconds = 20 * 1000; | 295 const int kNinetySeconds = 90 * 1000; |
| 296 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 296 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
| 297 new DelayedInitTask(directory_key, first_run), kTwentySeconds); | 297 new DelayedInitTask(directory_key, first_run), kNinetySeconds); |
| 298 return true; | 298 return true; |
| 299 } | 299 } |
| 300 | 300 |
| 301 bool RLZTracker::RecordProductEvent(Product product, AccessPoint point, | 301 bool RLZTracker::RecordProductEvent(Product product, AccessPoint point, |
| 302 Event event) { | 302 Event event) { |
| 303 return (record_event) ? record_event(product, point, event, NULL) : false; | 303 return (record_event) ? record_event(product, point, event, NULL) : false; |
| 304 } | 304 } |
| 305 | 305 |
| 306 bool RLZTracker::ClearAllProductEvents(Product product) { | 306 bool RLZTracker::ClearAllProductEvents(Product product) { |
| 307 return (clear_all_events) ? clear_all_events(product, NULL) : false; | 307 return (clear_all_events) ? clear_all_events(product, NULL) : false; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 328 cached_ommibox_rlz.assign(str_rlz); | 328 cached_ommibox_rlz.assign(str_rlz); |
| 329 } | 329 } |
| 330 *rlz = str_rlz; | 330 *rlz = str_rlz; |
| 331 return true; | 331 return true; |
| 332 } | 332 } |
| 333 | 333 |
| 334 // static | 334 // static |
| 335 void RLZTracker::CleanupRlz() { | 335 void RLZTracker::CleanupRlz() { |
| 336 OmniBoxUsageObserver::DeleteInstance(); | 336 OmniBoxUsageObserver::DeleteInstance(); |
| 337 } | 337 } |
| OLD | NEW |