OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome/browser/search_engines/search_terms_data.h" | 5 #include "chrome/browser/search_engines/search_terms_data.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/thread_restrictions.h" |
8 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/browser_thread.h" | 10 #include "chrome/browser/browser_thread.h" |
10 #include "chrome/browser/google/google_url_tracker.h" | 11 #include "chrome/browser/google/google_url_tracker.h" |
11 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
12 | 13 |
13 #if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD) | 14 #if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD) |
14 #include "chrome/browser/rlz/rlz.h" | 15 #include "chrome/browser/rlz/rlz.h" |
15 #include "chrome/installer/util/google_update_settings.h" | 16 #include "chrome/installer/util/google_update_settings.h" |
16 #endif | 17 #endif |
17 | 18 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 } | 73 } |
73 | 74 |
74 #if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD) | 75 #if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD) |
75 std::wstring UIThreadSearchTermsData::GetRlzParameterValue() const { | 76 std::wstring UIThreadSearchTermsData::GetRlzParameterValue() const { |
76 DCHECK(!BrowserThread::IsWellKnownThread(BrowserThread::UI) || | 77 DCHECK(!BrowserThread::IsWellKnownThread(BrowserThread::UI) || |
77 BrowserThread::CurrentlyOn(BrowserThread::UI)); | 78 BrowserThread::CurrentlyOn(BrowserThread::UI)); |
78 std::wstring rlz_string; | 79 std::wstring rlz_string; |
79 // For organic brandcodes do not use rlz at all. Empty brandcode usually | 80 // For organic brandcodes do not use rlz at all. Empty brandcode usually |
80 // means a chromium install. This is ok. | 81 // means a chromium install. This is ok. |
81 std::wstring brand; | 82 std::wstring brand; |
| 83 // See http://crbug.com/62337. |
| 84 base::ThreadRestrictions::ScopedAllowIO allow_io; |
82 if (GoogleUpdateSettings::GetBrand(&brand) && !brand.empty() && | 85 if (GoogleUpdateSettings::GetBrand(&brand) && !brand.empty() && |
83 !GoogleUpdateSettings::IsOrganic(brand)) | 86 !GoogleUpdateSettings::IsOrganic(brand)) |
84 RLZTracker::GetAccessPointRlz(rlz_lib::CHROME_OMNIBOX, &rlz_string); | 87 RLZTracker::GetAccessPointRlz(rlz_lib::CHROME_OMNIBOX, &rlz_string); |
85 return rlz_string; | 88 return rlz_string; |
86 } | 89 } |
87 #endif | 90 #endif |
88 | 91 |
89 // static | 92 // static |
90 void UIThreadSearchTermsData::SetGoogleBaseURL(std::string* google_base_url) { | 93 void UIThreadSearchTermsData::SetGoogleBaseURL(std::string* google_base_url) { |
91 delete google_base_url_; | 94 delete google_base_url_; |
92 google_base_url_ = google_base_url; | 95 google_base_url_ = google_base_url; |
93 } | 96 } |
OLD | NEW |