OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/profile_resetter/automatic_profile_resetter_delegate.h" | 5 #include "chrome/browser/profile_resetter/automatic_profile_resetter_delegate.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 | 251 |
252 scoped_ptr<base::ListValue> AutomaticProfileResetterDelegateImpl:: | 252 scoped_ptr<base::ListValue> AutomaticProfileResetterDelegateImpl:: |
253 GetPrepopulatedSearchProvidersDetails() const { | 253 GetPrepopulatedSearchProvidersDetails() const { |
254 size_t default_search_index = 0; | 254 size_t default_search_index = 0; |
255 ScopedVector<TemplateURLData> engines( | 255 ScopedVector<TemplateURLData> engines( |
256 TemplateURLPrepopulateData::GetPrepopulatedEngines( | 256 TemplateURLPrepopulateData::GetPrepopulatedEngines( |
257 profile_->GetPrefs(), &default_search_index)); | 257 profile_->GetPrefs(), &default_search_index)); |
258 scoped_ptr<base::ListValue> engines_details_list(new base::ListValue); | 258 scoped_ptr<base::ListValue> engines_details_list(new base::ListValue); |
259 for (ScopedVector<TemplateURLData>::const_iterator it = engines.begin(); | 259 for (ScopedVector<TemplateURLData>::const_iterator it = engines.begin(); |
260 it != engines.end(); ++it) { | 260 it != engines.end(); ++it) { |
261 TemplateURL template_url(profile_, **it); | 261 TemplateURL template_url(**it); |
262 engines_details_list->Append( | 262 engines_details_list->Append( |
263 BuildSubTreeFromTemplateURL(&template_url).release()); | 263 BuildSubTreeFromTemplateURL(&template_url).release()); |
264 } | 264 } |
265 return engines_details_list.Pass(); | 265 return engines_details_list.Pass(); |
266 } | 266 } |
267 | 267 |
268 bool AutomaticProfileResetterDelegateImpl::TriggerPrompt() { | 268 bool AutomaticProfileResetterDelegateImpl::TriggerPrompt() { |
269 DCHECK(global_error_service_); | 269 DCHECK(global_error_service_); |
270 | 270 |
271 if (!ProfileResetGlobalError::IsSupportedOnPlatform()) | 271 if (!ProfileResetGlobalError::IsSupportedOnPlatform()) |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 if (difference) { | 388 if (difference) { |
389 old_settings_snapshot->Subtract(new_settings_snapshot); | 389 old_settings_snapshot->Subtract(new_settings_snapshot); |
390 std::string report = | 390 std::string report = |
391 SerializeSettingsReport(*old_settings_snapshot, difference); | 391 SerializeSettingsReport(*old_settings_snapshot, difference); |
392 SendFeedback(report); | 392 SendFeedback(report); |
393 } | 393 } |
394 } | 394 } |
395 content::BrowserThread::PostTask( | 395 content::BrowserThread::PostTask( |
396 content::BrowserThread::UI, FROM_HERE, user_callback); | 396 content::BrowserThread::UI, FROM_HERE, user_callback); |
397 } | 397 } |
OLD | NEW |