OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
laefer
2014/05/25 21:21:58
https://engdoc.corp.google.com/eng/doc/devguide/cp
engedy
2014/05/26 18:00:45
Done, although I could not come up with anything m
| |
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" |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
237 return template_url_service_->is_default_search_managed(); | 237 return template_url_service_->is_default_search_managed(); |
238 } | 238 } |
239 | 239 |
240 scoped_ptr<base::ListValue> AutomaticProfileResetterDelegateImpl:: | 240 scoped_ptr<base::ListValue> AutomaticProfileResetterDelegateImpl:: |
241 GetPrepopulatedSearchProvidersDetails() const { | 241 GetPrepopulatedSearchProvidersDetails() const { |
242 size_t default_search_index = 0; | 242 size_t default_search_index = 0; |
243 ScopedVector<TemplateURLData> engines( | 243 ScopedVector<TemplateURLData> engines( |
244 TemplateURLPrepopulateData::GetPrepopulatedEngines( | 244 TemplateURLPrepopulateData::GetPrepopulatedEngines( |
245 profile_->GetPrefs(), &default_search_index)); | 245 profile_->GetPrefs(), &default_search_index)); |
246 scoped_ptr<base::ListValue> engines_details_list(new base::ListValue); | 246 scoped_ptr<base::ListValue> engines_details_list(new base::ListValue); |
247 for (ScopedVector<TemplateURLData>::const_iterator it = engines.begin(); | 247 for (ScopedVector<TemplateURLData>::const_iterator it = engines.begin(); |
laefer
2014/05/25 21:21:58
This can be rewritten more clearly as:
for (con
engedy
2014/05/26 18:00:46
Indeed, I could not agree more. -- However, for co
| |
248 it != engines.end(); ++it) { | 248 it != engines.end(); ++it) { |
249 TemplateURL template_url(profile_, **it); | 249 TemplateURL template_url(profile_, **it); |
250 engines_details_list->Append( | 250 engines_details_list->Append( |
251 BuildSubTreeFromTemplateURL(&template_url).release()); | 251 BuildSubTreeFromTemplateURL(&template_url).release()); |
252 } | 252 } |
253 return engines_details_list.Pass(); | 253 return engines_details_list.Pass(); |
254 } | 254 } |
255 | 255 |
256 bool AutomaticProfileResetterDelegateImpl::TriggerPrompt() { | 256 bool AutomaticProfileResetterDelegateImpl::TriggerPrompt() { |
257 DCHECK(global_error_service_); | 257 DCHECK(global_error_service_); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
376 if (difference) { | 376 if (difference) { |
377 old_settings_snapshot->Subtract(new_settings_snapshot); | 377 old_settings_snapshot->Subtract(new_settings_snapshot); |
378 std::string report = | 378 std::string report = |
379 SerializeSettingsReport(*old_settings_snapshot, difference); | 379 SerializeSettingsReport(*old_settings_snapshot, difference); |
380 SendFeedback(report); | 380 SendFeedback(report); |
381 } | 381 } |
382 } | 382 } |
383 content::BrowserThread::PostTask( | 383 content::BrowserThread::PostTask( |
384 content::BrowserThread::UI, FROM_HERE, user_callback); | 384 content::BrowserThread::UI, FROM_HERE, user_callback); |
385 } | 385 } |
386 | |
OLD | NEW |