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 1785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1796 const base::Value* user_pref_value = prefs_->GetUserPrefValue(pref); | 1796 const base::Value* user_pref_value = prefs_->GetUserPrefValue(pref); |
1797 const base::ListValue* user_pref_as_list; | 1797 const base::ListValue* user_pref_as_list; |
1798 if (!user_pref_value || !user_pref_value->GetAsList(&user_pref_as_list)) | 1798 if (!user_pref_value || !user_pref_value->GetAsList(&user_pref_as_list)) |
1799 return false; | 1799 return false; |
1800 | 1800 |
1801 std::insert_iterator<ExtensionIdContainer> insert_iterator( | 1801 std::insert_iterator<ExtensionIdContainer> insert_iterator( |
1802 *id_container_out, id_container_out->end()); | 1802 *id_container_out, id_container_out->end()); |
1803 std::string extension_id; | 1803 std::string extension_id; |
1804 for (base::ListValue::const_iterator value_it = user_pref_as_list->begin(); | 1804 for (base::ListValue::const_iterator value_it = user_pref_as_list->begin(); |
1805 value_it != user_pref_as_list->end(); ++value_it) { | 1805 value_it != user_pref_as_list->end(); ++value_it) { |
1806 if (!value_it->GetAsString(&extension_id)) { | 1806 if (!(*value_it)->GetAsString(&extension_id)) { |
1807 NOTREACHED(); | 1807 NOTREACHED(); |
1808 continue; | 1808 continue; |
1809 } | 1809 } |
1810 insert_iterator = extension_id; | 1810 insert_iterator = extension_id; |
1811 } | 1811 } |
1812 return true; | 1812 return true; |
1813 } | 1813 } |
1814 | 1814 |
1815 template <class ExtensionIdContainer> | 1815 template <class ExtensionIdContainer> |
1816 void ExtensionPrefs::SetExtensionPrefFromContainer( | 1816 void ExtensionPrefs::SetExtensionPrefFromContainer( |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1960 bool is_incognito_enabled = IsIncognitoEnabled(extension_id); | 1960 bool is_incognito_enabled = IsIncognitoEnabled(extension_id); |
1961 | 1961 |
1962 extension_pref_value_map_->RegisterExtension( | 1962 extension_pref_value_map_->RegisterExtension( |
1963 extension_id, install_time, is_enabled, is_incognito_enabled); | 1963 extension_id, install_time, is_enabled, is_incognito_enabled); |
1964 | 1964 |
1965 for (auto& observer : observer_list_) | 1965 for (auto& observer : observer_list_) |
1966 observer.OnExtensionRegistered(extension_id, install_time, is_enabled); | 1966 observer.OnExtensionRegistered(extension_id, install_time, is_enabled); |
1967 } | 1967 } |
1968 | 1968 |
1969 } // namespace extensions | 1969 } // namespace extensions |
OLD | NEW |