OLD | NEW |
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 // 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 bool IsBrandOrganic(const std::string& brand) { | 66 bool IsBrandOrganic(const std::string& brand) { |
67 return brand.empty() || google_util::IsOrganic(brand); | 67 return brand.empty() || google_util::IsOrganic(brand); |
68 } | 68 } |
69 | 69 |
70 void RecordProductEvents(bool first_run, | 70 void RecordProductEvents(bool first_run, |
71 bool is_google_default_search, | 71 bool is_google_default_search, |
72 bool is_google_homepage, | 72 bool is_google_homepage, |
73 bool is_google_in_startpages, | 73 bool is_google_in_startpages, |
74 bool already_ran, | 74 bool already_ran, |
75 bool omnibox_used, | 75 bool omnibox_used, |
76 bool homepage_used) { | 76 bool homepage_used, |
| 77 bool app_list_used) { |
77 TRACE_EVENT0("RLZ", "RecordProductEvents"); | 78 TRACE_EVENT0("RLZ", "RecordProductEvents"); |
78 // Record the installation of chrome. We call this all the time but the rlz | 79 // Record the installation of chrome. We call this all the time but the rlz |
79 // lib should ignore all but the first one. | 80 // lib should ignore all but the first one. |
80 rlz_lib::RecordProductEvent(rlz_lib::CHROME, | 81 rlz_lib::RecordProductEvent(rlz_lib::CHROME, |
81 RLZTracker::CHROME_OMNIBOX, | 82 RLZTracker::CHROME_OMNIBOX, |
82 rlz_lib::INSTALL); | 83 rlz_lib::INSTALL); |
83 rlz_lib::RecordProductEvent(rlz_lib::CHROME, | 84 rlz_lib::RecordProductEvent(rlz_lib::CHROME, |
84 RLZTracker::CHROME_HOME_PAGE, | 85 RLZTracker::CHROME_HOME_PAGE, |
85 rlz_lib::INSTALL); | 86 rlz_lib::INSTALL); |
| 87 #if !defined(OS_IOS) |
| 88 rlz_lib::RecordProductEvent(rlz_lib::CHROME, |
| 89 RLZTracker::CHROME_APP_LIST, |
| 90 rlz_lib::INSTALL); |
| 91 #endif |
86 | 92 |
87 if (!already_ran) { | 93 if (!already_ran) { |
88 // Do the initial event recording if is the first run or if we have an | 94 // Do the initial event recording if is the first run or if we have an |
89 // empty rlz which means we haven't got a chance to do it. | 95 // empty rlz which means we haven't got a chance to do it. |
90 char omnibox_rlz[rlz_lib::kMaxRlzLength + 1]; | 96 char omnibox_rlz[rlz_lib::kMaxRlzLength + 1]; |
91 if (!rlz_lib::GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, omnibox_rlz, | 97 if (!rlz_lib::GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, omnibox_rlz, |
92 rlz_lib::kMaxRlzLength)) { | 98 rlz_lib::kMaxRlzLength)) { |
93 omnibox_rlz[0] = 0; | 99 omnibox_rlz[0] = 0; |
94 } | 100 } |
95 | 101 |
96 // Record if google is the initial search provider and/or home page. | 102 // Record if google is the initial search provider and/or home page. |
97 if ((first_run || omnibox_rlz[0] == 0) && is_google_default_search) { | 103 if ((first_run || omnibox_rlz[0] == 0) && is_google_default_search) { |
98 rlz_lib::RecordProductEvent(rlz_lib::CHROME, | 104 rlz_lib::RecordProductEvent(rlz_lib::CHROME, |
99 RLZTracker::CHROME_OMNIBOX, | 105 RLZTracker::CHROME_OMNIBOX, |
100 rlz_lib::SET_TO_GOOGLE); | 106 rlz_lib::SET_TO_GOOGLE); |
101 } | 107 } |
102 | 108 |
103 char homepage_rlz[rlz_lib::kMaxRlzLength + 1]; | 109 char homepage_rlz[rlz_lib::kMaxRlzLength + 1]; |
104 if (!rlz_lib::GetAccessPointRlz(RLZTracker::CHROME_HOME_PAGE, homepage_rlz, | 110 if (!rlz_lib::GetAccessPointRlz(RLZTracker::CHROME_HOME_PAGE, homepage_rlz, |
105 rlz_lib::kMaxRlzLength)) { | 111 rlz_lib::kMaxRlzLength)) { |
106 homepage_rlz[0] = 0; | 112 homepage_rlz[0] = 0; |
107 } | 113 } |
108 | 114 |
109 if ((first_run || homepage_rlz[0] == 0) && | 115 if ((first_run || homepage_rlz[0] == 0) && |
110 (is_google_homepage || is_google_in_startpages)) { | 116 (is_google_homepage || is_google_in_startpages)) { |
111 rlz_lib::RecordProductEvent(rlz_lib::CHROME, | 117 rlz_lib::RecordProductEvent(rlz_lib::CHROME, |
112 RLZTracker::CHROME_HOME_PAGE, | 118 RLZTracker::CHROME_HOME_PAGE, |
113 rlz_lib::SET_TO_GOOGLE); | 119 rlz_lib::SET_TO_GOOGLE); |
114 } | 120 } |
| 121 |
| 122 #if !defined(OS_IOS) |
| 123 char app_list_rlz[rlz_lib::kMaxRlzLength + 1]; |
| 124 if (!rlz_lib::GetAccessPointRlz(RLZTracker::CHROME_APP_LIST, app_list_rlz, |
| 125 rlz_lib::kMaxRlzLength)) { |
| 126 app_list_rlz[0] = 0; |
| 127 } |
| 128 |
| 129 // Record if google is the initial search provider and/or home page. |
| 130 if ((first_run || app_list_rlz[0] == 0) && is_google_default_search) { |
| 131 rlz_lib::RecordProductEvent(rlz_lib::CHROME, |
| 132 RLZTracker::CHROME_APP_LIST, |
| 133 rlz_lib::SET_TO_GOOGLE); |
| 134 } |
| 135 #endif |
115 } | 136 } |
116 | 137 |
117 // Record first user interaction with the omnibox. We call this all the | 138 // Record first user interaction with the omnibox. We call this all the |
118 // time but the rlz lib should ingore all but the first one. | 139 // time but the rlz lib should ingore all but the first one. |
119 if (omnibox_used) { | 140 if (omnibox_used) { |
120 rlz_lib::RecordProductEvent(rlz_lib::CHROME, | 141 rlz_lib::RecordProductEvent(rlz_lib::CHROME, |
121 RLZTracker::CHROME_OMNIBOX, | 142 RLZTracker::CHROME_OMNIBOX, |
122 rlz_lib::FIRST_SEARCH); | 143 rlz_lib::FIRST_SEARCH); |
123 } | 144 } |
124 | 145 |
125 // Record first user interaction with the home page. We call this all the | 146 // Record first user interaction with the home page. We call this all the |
126 // time but the rlz lib should ingore all but the first one. | 147 // time but the rlz lib should ingore all but the first one. |
127 if (homepage_used || is_google_in_startpages) { | 148 if (homepage_used || is_google_in_startpages) { |
128 rlz_lib::RecordProductEvent(rlz_lib::CHROME, | 149 rlz_lib::RecordProductEvent(rlz_lib::CHROME, |
129 RLZTracker::CHROME_HOME_PAGE, | 150 RLZTracker::CHROME_HOME_PAGE, |
130 rlz_lib::FIRST_SEARCH); | 151 rlz_lib::FIRST_SEARCH); |
131 } | 152 } |
| 153 |
| 154 #if !defined(OS_IOS) |
| 155 // Record first user interaction with the app list. We call this all the |
| 156 // time but the rlz lib should ingore all but the first one. |
| 157 if (app_list_used) { |
| 158 rlz_lib::RecordProductEvent(rlz_lib::CHROME, |
| 159 RLZTracker::CHROME_APP_LIST, |
| 160 rlz_lib::FIRST_SEARCH); |
| 161 } |
| 162 #endif |
132 } | 163 } |
133 | 164 |
134 bool SendFinancialPing(const std::string& brand, | 165 bool SendFinancialPing(const std::string& brand, |
135 const base::string16& lang, | 166 const base::string16& lang, |
136 const base::string16& referral) { | 167 const base::string16& referral) { |
137 rlz_lib::AccessPoint points[] = {RLZTracker::CHROME_OMNIBOX, | 168 rlz_lib::AccessPoint points[] = {RLZTracker::CHROME_OMNIBOX, |
138 RLZTracker::CHROME_HOME_PAGE, | 169 RLZTracker::CHROME_HOME_PAGE, |
| 170 #if !defined(OS_IOS) |
| 171 RLZTracker::CHROME_APP_LIST, |
| 172 #endif |
139 rlz_lib::NO_ACCESS_POINT}; | 173 rlz_lib::NO_ACCESS_POINT}; |
140 std::string lang_ascii(base::UTF16ToASCII(lang)); | 174 std::string lang_ascii(base::UTF16ToASCII(lang)); |
141 std::string referral_ascii(base::UTF16ToASCII(referral)); | 175 std::string referral_ascii(base::UTF16ToASCII(referral)); |
142 std::string product_signature; | 176 std::string product_signature; |
143 #if defined(OS_CHROMEOS) | 177 #if defined(OS_CHROMEOS) |
144 product_signature = "chromeos"; | 178 product_signature = "chromeos"; |
145 #else | 179 #else |
146 product_signature = "chrome"; | 180 product_signature = "chrome"; |
147 #endif | 181 #endif |
148 return rlz_lib::SendFinancialPing(rlz_lib::CHROME, points, | 182 return rlz_lib::SendFinancialPing(rlz_lib::CHROME, points, |
149 product_signature.c_str(), | 183 product_signature.c_str(), |
150 brand.c_str(), referral_ascii.c_str(), | 184 brand.c_str(), referral_ascii.c_str(), |
151 lang_ascii.c_str(), false, true); | 185 lang_ascii.c_str(), false, true); |
152 } | 186 } |
153 | 187 |
154 } // namespace | 188 } // namespace |
155 | 189 |
156 #if defined(OS_WIN) | 190 #if defined(OS_WIN) |
157 // static | 191 // static |
158 const rlz_lib::AccessPoint RLZTracker::CHROME_OMNIBOX = | 192 const rlz_lib::AccessPoint RLZTracker::CHROME_OMNIBOX = |
159 rlz_lib::CHROME_OMNIBOX; | 193 rlz_lib::CHROME_OMNIBOX; |
160 // static | 194 // static |
161 const rlz_lib::AccessPoint RLZTracker::CHROME_HOME_PAGE = | 195 const rlz_lib::AccessPoint RLZTracker::CHROME_HOME_PAGE = |
162 rlz_lib::CHROME_HOME_PAGE; | 196 rlz_lib::CHROME_HOME_PAGE; |
| 197 // static |
| 198 const rlz_lib::AccessPoint RLZTracker::CHROME_APP_LIST = |
| 199 rlz_lib::CHROME_APP_LIST; |
163 #elif defined(OS_IOS) | 200 #elif defined(OS_IOS) |
164 // static | 201 // static |
165 const rlz_lib::AccessPoint RLZTracker::CHROME_OMNIBOX = | 202 const rlz_lib::AccessPoint RLZTracker::CHROME_OMNIBOX = |
166 rlz_lib::CHROME_IOS_OMNIBOX; | 203 rlz_lib::CHROME_IOS_OMNIBOX; |
167 // static | 204 // static |
168 const rlz_lib::AccessPoint RLZTracker::CHROME_HOME_PAGE = | 205 const rlz_lib::AccessPoint RLZTracker::CHROME_HOME_PAGE = |
169 rlz_lib::CHROME_IOS_HOME_PAGE; | 206 rlz_lib::CHROME_IOS_HOME_PAGE; |
170 #elif defined(OS_MACOSX) | 207 #elif defined(OS_MACOSX) |
171 // static | 208 // static |
172 const rlz_lib::AccessPoint RLZTracker::CHROME_OMNIBOX = | 209 const rlz_lib::AccessPoint RLZTracker::CHROME_OMNIBOX = |
173 rlz_lib::CHROME_MAC_OMNIBOX; | 210 rlz_lib::CHROME_MAC_OMNIBOX; |
174 // static | 211 // static |
175 const rlz_lib::AccessPoint RLZTracker::CHROME_HOME_PAGE = | 212 const rlz_lib::AccessPoint RLZTracker::CHROME_HOME_PAGE = |
176 rlz_lib::CHROME_MAC_HOME_PAGE; | 213 rlz_lib::CHROME_MAC_HOME_PAGE; |
| 214 // static |
| 215 const rlz_lib::AccessPoint RLZTracker::CHROME_APP_LIST = |
| 216 rlz_lib::CHROME_MAC_APP_LIST; |
177 #elif defined(OS_CHROMEOS) | 217 #elif defined(OS_CHROMEOS) |
178 // static | 218 // static |
179 const rlz_lib::AccessPoint RLZTracker::CHROME_OMNIBOX = | 219 const rlz_lib::AccessPoint RLZTracker::CHROME_OMNIBOX = |
180 rlz_lib::CHROMEOS_OMNIBOX; | 220 rlz_lib::CHROMEOS_OMNIBOX; |
181 // static | 221 // static |
182 const rlz_lib::AccessPoint RLZTracker::CHROME_HOME_PAGE = | 222 const rlz_lib::AccessPoint RLZTracker::CHROME_HOME_PAGE = |
183 rlz_lib::CHROMEOS_HOME_PAGE; | 223 rlz_lib::CHROMEOS_HOME_PAGE; |
| 224 // static |
| 225 const rlz_lib::AccessPoint RLZTracker::CHROME_APP_LIST = |
| 226 rlz_lib::CHROMEOS_APP_LIST; |
184 #endif | 227 #endif |
185 | 228 |
186 RLZTracker* RLZTracker::tracker_ = NULL; | 229 RLZTracker* RLZTracker::tracker_ = NULL; |
187 | 230 |
188 // static | 231 // static |
189 RLZTracker* RLZTracker::GetInstance() { | 232 RLZTracker* RLZTracker::GetInstance() { |
190 return tracker_ ? tracker_ : Singleton<RLZTracker>::get(); | 233 return tracker_ ? tracker_ : Singleton<RLZTracker>::get(); |
191 } | 234 } |
192 | 235 |
193 RLZTracker::RLZTracker() | 236 RLZTracker::RLZTracker() |
194 : first_run_(false), | 237 : first_run_(false), |
195 send_ping_immediately_(false), | 238 send_ping_immediately_(false), |
196 is_google_default_search_(false), | 239 is_google_default_search_(false), |
197 is_google_homepage_(false), | 240 is_google_homepage_(false), |
198 is_google_in_startpages_(false), | 241 is_google_in_startpages_(false), |
199 worker_pool_token_(BrowserThread::GetBlockingPool()->GetSequenceToken()), | 242 worker_pool_token_(BrowserThread::GetBlockingPool()->GetSequenceToken()), |
200 already_ran_(false), | 243 already_ran_(false), |
201 omnibox_used_(false), | 244 omnibox_used_(false), |
202 homepage_used_(false), | 245 homepage_used_(false), |
| 246 app_list_used_(false), |
203 min_init_delay_(kMinInitDelay) { | 247 min_init_delay_(kMinInitDelay) { |
204 } | 248 } |
205 | 249 |
206 RLZTracker::~RLZTracker() { | 250 RLZTracker::~RLZTracker() { |
207 } | 251 } |
208 | 252 |
209 // static | 253 // static |
210 bool RLZTracker::InitRlzDelayed(bool first_run, | 254 bool RLZTracker::InitRlzDelayed(bool first_run, |
211 bool send_ping_immediately, | 255 bool send_ping_immediately, |
212 base::TimeDelta delay, | 256 base::TimeDelta delay, |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 } | 363 } |
320 | 364 |
321 void RLZTracker::DelayedInit() { | 365 void RLZTracker::DelayedInit() { |
322 bool schedule_ping = false; | 366 bool schedule_ping = false; |
323 | 367 |
324 // For organic brandcodes do not use rlz at all. Empty brandcode usually | 368 // For organic brandcodes do not use rlz at all. Empty brandcode usually |
325 // means a chromium install. This is ok. | 369 // means a chromium install. This is ok. |
326 if (!IsBrandOrganic(brand_)) { | 370 if (!IsBrandOrganic(brand_)) { |
327 RecordProductEvents(first_run_, is_google_default_search_, | 371 RecordProductEvents(first_run_, is_google_default_search_, |
328 is_google_homepage_, is_google_in_startpages_, | 372 is_google_homepage_, is_google_in_startpages_, |
329 already_ran_, omnibox_used_, homepage_used_); | 373 already_ran_, omnibox_used_, homepage_used_, |
| 374 app_list_used_); |
330 schedule_ping = true; | 375 schedule_ping = true; |
331 } | 376 } |
332 | 377 |
333 // If chrome has been reactivated, record the events for this brand | 378 // If chrome has been reactivated, record the events for this brand |
334 // as well. | 379 // as well. |
335 if (!IsBrandOrganic(reactivation_brand_)) { | 380 if (!IsBrandOrganic(reactivation_brand_)) { |
336 rlz_lib::SupplementaryBranding branding(reactivation_brand_.c_str()); | 381 rlz_lib::SupplementaryBranding branding(reactivation_brand_.c_str()); |
337 RecordProductEvents(first_run_, is_google_default_search_, | 382 RecordProductEvents(first_run_, is_google_default_search_, |
338 is_google_homepage_, is_google_in_startpages_, | 383 is_google_homepage_, is_google_in_startpages_, |
339 already_ran_, omnibox_used_, homepage_used_); | 384 already_ran_, omnibox_used_, homepage_used_, |
| 385 app_list_used_); |
340 schedule_ping = true; | 386 schedule_ping = true; |
341 } | 387 } |
342 | 388 |
343 already_ran_ = true; | 389 already_ran_ = true; |
344 | 390 |
345 if (schedule_ping) | 391 if (schedule_ping) |
346 ScheduleFinancialPing(); | 392 ScheduleFinancialPing(); |
347 } | 393 } |
348 | 394 |
349 void RLZTracker::ScheduleFinancialPing() { | 395 void RLZTracker::ScheduleFinancialPing() { |
(...skipping 17 matching lines...) Expand all Loading... |
367 GoogleUpdateSettings::ClearReferral(); | 413 GoogleUpdateSettings::ClearReferral(); |
368 | 414 |
369 { | 415 { |
370 base::AutoLock lock(cache_lock_); | 416 base::AutoLock lock(cache_lock_); |
371 rlz_cache_.clear(); | 417 rlz_cache_.clear(); |
372 } | 418 } |
373 | 419 |
374 // Prime the RLZ cache for the access points we are interested in. | 420 // Prime the RLZ cache for the access points we are interested in. |
375 GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, NULL); | 421 GetAccessPointRlz(RLZTracker::CHROME_OMNIBOX, NULL); |
376 GetAccessPointRlz(RLZTracker::CHROME_HOME_PAGE, NULL); | 422 GetAccessPointRlz(RLZTracker::CHROME_HOME_PAGE, NULL); |
| 423 #if !defined(OS_IOS) |
| 424 GetAccessPointRlz(RLZTracker::CHROME_APP_LIST, NULL); |
| 425 #endif |
377 } | 426 } |
378 | 427 |
379 if (!IsBrandOrganic(reactivation_brand_)) { | 428 if (!IsBrandOrganic(reactivation_brand_)) { |
380 rlz_lib::SupplementaryBranding branding(reactivation_brand_.c_str()); | 429 rlz_lib::SupplementaryBranding branding(reactivation_brand_.c_str()); |
381 SendFinancialPing(reactivation_brand_, lang, referral); | 430 SendFinancialPing(reactivation_brand_, lang, referral); |
382 } | 431 } |
383 } | 432 } |
384 | 433 |
385 bool RLZTracker::SendFinancialPing(const std::string& brand, | 434 bool RLZTracker::SendFinancialPing(const std::string& brand, |
386 const base::string16& lang, | 435 const base::string16& lang, |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 | 505 |
457 return true; | 506 return true; |
458 } | 507 } |
459 | 508 |
460 void RLZTracker::RecordFirstSearch(rlz_lib::AccessPoint point) { | 509 void RLZTracker::RecordFirstSearch(rlz_lib::AccessPoint point) { |
461 // Make sure we don't access disk outside of the I/O thread. | 510 // Make sure we don't access disk outside of the I/O thread. |
462 // In such case we repost the task on the right thread and return error. | 511 // In such case we repost the task on the right thread and return error. |
463 if (ScheduleRecordFirstSearch(point)) | 512 if (ScheduleRecordFirstSearch(point)) |
464 return; | 513 return; |
465 | 514 |
466 bool* record_used = point == CHROME_OMNIBOX ? | 515 bool* record_used = GetAccessPointRecord(point); |
467 &omnibox_used_ : &homepage_used_; | |
468 | 516 |
469 // Try to record event now, else set the flag to try later when we | 517 // Try to record event now, else set the flag to try later when we |
470 // attempt the ping. | 518 // attempt the ping. |
471 if (!RecordProductEvent(rlz_lib::CHROME, point, rlz_lib::FIRST_SEARCH)) | 519 if (!RecordProductEvent(rlz_lib::CHROME, point, rlz_lib::FIRST_SEARCH)) |
472 *record_used = true; | 520 *record_used = true; |
473 else if (send_ping_immediately_ && point == CHROME_OMNIBOX) | 521 else if (send_ping_immediately_ && point == CHROME_OMNIBOX) |
474 ScheduleDelayedInit(base::TimeDelta()); | 522 ScheduleDelayedInit(base::TimeDelta()); |
475 } | 523 } |
476 | 524 |
477 bool RLZTracker::ScheduleRecordFirstSearch(rlz_lib::AccessPoint point) { | 525 bool RLZTracker::ScheduleRecordFirstSearch(rlz_lib::AccessPoint point) { |
478 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) | 526 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) |
479 return false; | 527 return false; |
480 BrowserThread::GetBlockingPool()->PostSequencedWorkerTaskWithShutdownBehavior( | 528 BrowserThread::GetBlockingPool()->PostSequencedWorkerTaskWithShutdownBehavior( |
481 worker_pool_token_, | 529 worker_pool_token_, |
482 FROM_HERE, | 530 FROM_HERE, |
483 base::Bind(&RLZTracker::RecordFirstSearch, | 531 base::Bind(&RLZTracker::RecordFirstSearch, |
484 base::Unretained(this), point), | 532 base::Unretained(this), point), |
485 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); | 533 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); |
486 return true; | 534 return true; |
487 } | 535 } |
488 | 536 |
| 537 bool* RLZTracker::GetAccessPointRecord(rlz_lib::AccessPoint point) { |
| 538 if (point == CHROME_OMNIBOX) |
| 539 return &omnibox_used_; |
| 540 if (point == CHROME_HOME_PAGE) |
| 541 return &homepage_used_; |
| 542 #if !defined(OS_IOS) |
| 543 if (point == CHROME_APP_LIST) |
| 544 return &app_list_used_; |
| 545 #endif |
| 546 NOTREACHED(); |
| 547 return NULL; |
| 548 } |
| 549 |
489 // static | 550 // static |
490 std::string RLZTracker::GetAccessPointHttpHeader(rlz_lib::AccessPoint point) { | 551 std::string RLZTracker::GetAccessPointHttpHeader(rlz_lib::AccessPoint point) { |
491 TRACE_EVENT0("RLZ", "RLZTracker::GetAccessPointHttpHeader"); | 552 TRACE_EVENT0("RLZ", "RLZTracker::GetAccessPointHttpHeader"); |
492 std::string extra_headers; | 553 std::string extra_headers; |
493 base::string16 rlz_string; | 554 base::string16 rlz_string; |
494 RLZTracker::GetAccessPointRlz(point, &rlz_string); | 555 RLZTracker::GetAccessPointRlz(point, &rlz_string); |
495 if (!rlz_string.empty()) { | 556 if (!rlz_string.empty()) { |
496 net::HttpUtil::AppendHeaderIfMissing("X-Rlz-String", | 557 net::HttpUtil::AppendHeaderIfMissing("X-Rlz-String", |
497 base::UTF16ToUTF8(rlz_string), | 558 base::UTF16ToUTF8(rlz_string), |
498 &extra_headers); | 559 &extra_headers); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 void RLZTracker::CleanupRlz() { | 647 void RLZTracker::CleanupRlz() { |
587 GetInstance()->rlz_cache_.clear(); | 648 GetInstance()->rlz_cache_.clear(); |
588 GetInstance()->registrar_.RemoveAll(); | 649 GetInstance()->registrar_.RemoveAll(); |
589 rlz_lib::SetURLRequestContext(NULL); | 650 rlz_lib::SetURLRequestContext(NULL); |
590 } | 651 } |
591 | 652 |
592 // static | 653 // static |
593 void RLZTracker::EnableZeroDelayForTesting() { | 654 void RLZTracker::EnableZeroDelayForTesting() { |
594 GetInstance()->min_init_delay_ = base::TimeDelta(); | 655 GetInstance()->min_init_delay_ = base::TimeDelta(); |
595 } | 656 } |
| 657 |
| 658 #if !defined(OS_IOS) |
| 659 // static |
| 660 void RLZTracker::RecordAppListSearch() { |
| 661 GetInstance()->RecordFirstSearch(RLZTracker::CHROME_APP_LIST); |
| 662 } |
| 663 #endif |
OLD | NEW |