| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/extension_prefs.h" | 5 #include "extensions/browser/extension_prefs.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <iterator> | 10 #include <iterator> |
| (...skipping 1784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1795 const base::Value* user_pref_value = prefs_->GetUserPrefValue(pref); | 1795 const base::Value* user_pref_value = prefs_->GetUserPrefValue(pref); |
| 1796 const base::ListValue* user_pref_as_list; | 1796 const base::ListValue* user_pref_as_list; |
| 1797 if (!user_pref_value || !user_pref_value->GetAsList(&user_pref_as_list)) | 1797 if (!user_pref_value || !user_pref_value->GetAsList(&user_pref_as_list)) |
| 1798 return false; | 1798 return false; |
| 1799 | 1799 |
| 1800 std::insert_iterator<ExtensionIdContainer> insert_iterator( | 1800 std::insert_iterator<ExtensionIdContainer> insert_iterator( |
| 1801 *id_container_out, id_container_out->end()); | 1801 *id_container_out, id_container_out->end()); |
| 1802 std::string extension_id; | 1802 std::string extension_id; |
| 1803 for (base::ListValue::const_iterator value_it = user_pref_as_list->begin(); | 1803 for (base::ListValue::const_iterator value_it = user_pref_as_list->begin(); |
| 1804 value_it != user_pref_as_list->end(); ++value_it) { | 1804 value_it != user_pref_as_list->end(); ++value_it) { |
| 1805 if (!(*value_it)->GetAsString(&extension_id)) { | 1805 if (!value_it->GetAsString(&extension_id)) { |
| 1806 NOTREACHED(); | 1806 NOTREACHED(); |
| 1807 continue; | 1807 continue; |
| 1808 } | 1808 } |
| 1809 insert_iterator = extension_id; | 1809 insert_iterator = extension_id; |
| 1810 } | 1810 } |
| 1811 return true; | 1811 return true; |
| 1812 } | 1812 } |
| 1813 | 1813 |
| 1814 template <class ExtensionIdContainer> | 1814 template <class ExtensionIdContainer> |
| 1815 void ExtensionPrefs::SetExtensionPrefFromContainer( | 1815 void ExtensionPrefs::SetExtensionPrefFromContainer( |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1959 bool is_incognito_enabled = IsIncognitoEnabled(extension_id); | 1959 bool is_incognito_enabled = IsIncognitoEnabled(extension_id); |
| 1960 | 1960 |
| 1961 extension_pref_value_map_->RegisterExtension( | 1961 extension_pref_value_map_->RegisterExtension( |
| 1962 extension_id, install_time, is_enabled, is_incognito_enabled); | 1962 extension_id, install_time, is_enabled, is_incognito_enabled); |
| 1963 | 1963 |
| 1964 for (auto& observer : observer_list_) | 1964 for (auto& observer : observer_list_) |
| 1965 observer.OnExtensionRegistered(extension_id, install_time, is_enabled); | 1965 observer.OnExtensionRegistered(extension_id, install_time, is_enabled); |
| 1966 } | 1966 } |
| 1967 | 1967 |
| 1968 } // namespace extensions | 1968 } // namespace extensions |
| OLD | NEW |