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 #include "chrome/browser/search_engines/search_provider_install_data.h" | 5 #include "chrome/browser/search_engines/search_provider_install_data.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 Profile* profile, | 160 Profile* profile, |
161 int ui_death_notification, | 161 int ui_death_notification, |
162 const content::NotificationSource& ui_death_source) | 162 const content::NotificationSource& ui_death_source) |
163 : web_service_(WebDataService::FromBrowserContext(profile)), | 163 : web_service_(WebDataService::FromBrowserContext(profile)), |
164 load_handle_(0), | 164 load_handle_(0), |
165 google_base_url_(UIThreadSearchTermsData(profile).GoogleBaseURLValue()) { | 165 google_base_url_(UIThreadSearchTermsData(profile).GoogleBaseURLValue()) { |
166 // GoogleURLObserver is responsible for killing itself when | 166 // GoogleURLObserver is responsible for killing itself when |
167 // the given notification occurs. | 167 // the given notification occurs. |
168 new GoogleURLObserver(profile, new GoogleURLChangeNotifier(AsWeakPtr()), | 168 new GoogleURLObserver(profile, new GoogleURLChangeNotifier(AsWeakPtr()), |
169 ui_death_notification, ui_death_source); | 169 ui_death_notification, ui_death_source); |
170 DetachFromThread(); | |
171 } | 170 } |
172 | 171 |
173 SearchProviderInstallData::~SearchProviderInstallData() { | 172 SearchProviderInstallData::~SearchProviderInstallData() { |
174 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 173 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
175 | 174 |
176 if (load_handle_) { | 175 if (load_handle_) { |
177 DCHECK(web_service_.get()); | 176 DCHECK(web_service_.get()); |
178 web_service_->CancelRequest(load_handle_); | 177 web_service_->CancelRequest(load_handle_); |
179 } | 178 } |
180 } | 179 } |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 | 295 |
297 std::for_each(closure_queue.begin(), | 296 std::for_each(closure_queue.begin(), |
298 closure_queue.end(), | 297 closure_queue.end(), |
299 std::mem_fun_ref(&base::Closure::Run)); | 298 std::mem_fun_ref(&base::Closure::Run)); |
300 | 299 |
301 // Since we expect this request to be rare, clear out the information. This | 300 // Since we expect this request to be rare, clear out the information. This |
302 // also keeps the responses current as the search providers change. | 301 // also keeps the responses current as the search providers change. |
303 provider_map_.reset(); | 302 provider_map_.reset(); |
304 SetDefault(NULL); | 303 SetDefault(NULL); |
305 } | 304 } |
OLD | NEW |