OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 // Organic brands all start with GG, such as GGCM. | 169 // Organic brands all start with GG, such as GGCM. |
170 static bool is_organic(const std::wstring& brand) { | 170 static bool is_organic(const std::wstring& brand) { |
171 return (brand.size() < 2) ? false : (brand.substr(0, 2) == L"GG"); | 171 return (brand.size() < 2) ? false : (brand.substr(0, 2) == L"GG"); |
172 } | 172 } |
173 }; | 173 }; |
174 | 174 |
175 // Performs late RLZ initialization and RLZ event recording for chrome. | 175 // Performs late RLZ initialization and RLZ event recording for chrome. |
176 // This task needs to run on the UI thread. | 176 // This task needs to run on the UI thread. |
177 class DelayedInitTask : public Task { | 177 class DelayedInitTask : public Task { |
178 public: | 178 public: |
179 explicit DelayedInitTask(bool first_run, bool google_default_search) | 179 DelayedInitTask(bool first_run, bool google_default_search) |
180 : first_run_(first_run), | 180 : first_run_(first_run), |
181 google_default_search_(google_default_search) { | 181 google_default_search_(google_default_search) { |
182 } | 182 } |
183 virtual ~DelayedInitTask() { | 183 virtual ~DelayedInitTask() { |
184 } | 184 } |
185 virtual void Run() { | 185 virtual void Run() { |
186 // For non-interactive tests we don't do the rest of the initialization | 186 // For non-interactive tests we don't do the rest of the initialization |
187 // because sometimes the very act of loading the dll causes QEMU to crash. | 187 // because sometimes the very act of loading the dll causes QEMU to crash. |
188 if (::GetEnvironmentVariableW(ASCIIToWide(env_vars::kHeadless).c_str(), | 188 if (::GetEnvironmentVariableW(ASCIIToWide(env_vars::kHeadless).c_str(), |
189 NULL, 0)) { | 189 NULL, 0)) { |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 cached_ommibox_rlz.assign(*rlz); | 388 cached_ommibox_rlz.assign(*rlz); |
389 access_values_state = ACCESS_VALUES_FRESH; | 389 access_values_state = ACCESS_VALUES_FRESH; |
390 } | 390 } |
391 return true; | 391 return true; |
392 } | 392 } |
393 | 393 |
394 // static | 394 // static |
395 void RLZTracker::CleanupRlz() { | 395 void RLZTracker::CleanupRlz() { |
396 OmniBoxUsageObserver::DeleteInstance(); | 396 OmniBoxUsageObserver::DeleteInstance(); |
397 } | 397 } |
OLD | NEW |