OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/resettable_settings_snapshot.h" | 5 #include "chrome/browser/profile_resetter/resettable_settings_snapshot.h" |
6 | 6 |
7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 TemplateURLService* service = | 58 TemplateURLService* service = |
59 TemplateURLServiceFactory::GetForProfile(profile); | 59 TemplateURLServiceFactory::GetForProfile(profile); |
60 DCHECK(service); | 60 DCHECK(service); |
61 TemplateURL* dse = service->GetDefaultSearchProvider(); | 61 TemplateURL* dse = service->GetDefaultSearchProvider(); |
62 if (dse) | 62 if (dse) |
63 dse_url_ = dse->url(); | 63 dse_url_ = dse->url(); |
64 | 64 |
65 ExtensionService* extension_service = profile->GetExtensionService(); | 65 ExtensionService* extension_service = profile->GetExtensionService(); |
66 DCHECK(extension_service); | 66 DCHECK(extension_service); |
67 const ExtensionSet* enabled_ext = extension_service->extensions(); | 67 const extensions::ExtensionSet* enabled_ext = extension_service->extensions(); |
68 enabled_extensions_.reserve(enabled_ext->size()); | 68 enabled_extensions_.reserve(enabled_ext->size()); |
69 | 69 |
70 for (ExtensionSet::const_iterator it = enabled_ext->begin(); | 70 for (extensions::ExtensionSet::const_iterator it = enabled_ext->begin(); |
71 it != enabled_ext->end(); ++it) | 71 it != enabled_ext->end(); ++it) |
72 enabled_extensions_.push_back(std::make_pair((*it)->id(), (*it)->name())); | 72 enabled_extensions_.push_back(std::make_pair((*it)->id(), (*it)->name())); |
73 | 73 |
74 // ExtensionSet is sorted but it seems to be an implementation detail. | 74 // ExtensionSet is sorted but it seems to be an implementation detail. |
75 std::sort(enabled_extensions_.begin(), enabled_extensions_.end()); | 75 std::sort(enabled_extensions_.begin(), enabled_extensions_.end()); |
76 } | 76 } |
77 | 77 |
78 ResettableSettingsSnapshot::~ResettableSettingsSnapshot() {} | 78 ResettableSettingsSnapshot::~ResettableSettingsSnapshot() {} |
79 | 79 |
80 void ResettableSettingsSnapshot::Subtract( | 80 void ResettableSettingsSnapshot::Subtract( |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 (extension_names += i->second) += '\n'; | 257 (extension_names += i->second) += '\n'; |
258 } | 258 } |
259 if (!extension_names.empty()) { | 259 if (!extension_names.empty()) { |
260 extension_names.erase(extension_names.end() - 1); | 260 extension_names.erase(extension_names.end() - 1); |
261 AddPair(list, | 261 AddPair(list, |
262 l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_EXTENSIONS), | 262 l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_EXTENSIONS), |
263 extension_names); | 263 extension_names); |
264 } | 264 } |
265 return list; | 265 return list; |
266 } | 266 } |
OLD | NEW |