OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 if (!PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) | 265 if (!PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) |
266 return false; | 266 return false; |
267 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 267 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
268 Profile* profile = profile_manager->GetDefaultProfile(user_data_dir); | 268 Profile* profile = profile_manager->GetDefaultProfile(user_data_dir); |
269 if (!profile) | 269 if (!profile) |
270 return false; | 270 return false; |
271 const TemplateURL* url_template = | 271 const TemplateURL* url_template = |
272 profile->GetTemplateURLModel()->GetDefaultSearchProvider(); | 272 profile->GetTemplateURLModel()->GetDefaultSearchProvider(); |
273 if (!url_template) | 273 if (!url_template) |
274 return false; | 274 return false; |
275 return url_template->url()->HasGoogleBaseURLs(); | 275 const TemplateURLRef* urlref = url_template->url(); |
| 276 if (!urlref) |
| 277 return false; |
| 278 return urlref->HasGoogleBaseURLs(); |
276 } | 279 } |
277 | 280 |
278 int directory_key_; | 281 int directory_key_; |
279 bool first_run_; | 282 bool first_run_; |
280 DISALLOW_IMPLICIT_CONSTRUCTORS(DelayedInitTask); | 283 DISALLOW_IMPLICIT_CONSTRUCTORS(DelayedInitTask); |
281 }; | 284 }; |
282 | 285 |
283 } // namespace | 286 } // namespace |
284 | 287 |
285 bool RLZTracker::InitRlz(int directory_key) { | 288 bool RLZTracker::InitRlz(int directory_key) { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 cached_ommibox_rlz.assign(str_rlz); | 338 cached_ommibox_rlz.assign(str_rlz); |
336 } | 339 } |
337 *rlz = str_rlz; | 340 *rlz = str_rlz; |
338 return true; | 341 return true; |
339 } | 342 } |
340 | 343 |
341 // static | 344 // static |
342 void RLZTracker::CleanupRlz() { | 345 void RLZTracker::CleanupRlz() { |
343 OmniBoxUsageObserver::DeleteInstance(); | 346 OmniBoxUsageObserver::DeleteInstance(); |
344 } | 347 } |
OLD | NEW |