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 <iterator> | 7 #include <iterator> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/prefs/pref_notifier.h" | 10 #include "base/prefs/pref_notifier.h" |
(...skipping 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1890 DVLOG(1) << "SetInstallSignature - saving"; | 1890 DVLOG(1) << "SetInstallSignature - saving"; |
1891 } else { | 1891 } else { |
1892 DVLOG(1) << "SetInstallSignature - clearing"; | 1892 DVLOG(1) << "SetInstallSignature - clearing"; |
1893 prefs_->ClearPref(kInstallSignature); | 1893 prefs_->ClearPref(kInstallSignature); |
1894 } | 1894 } |
1895 } | 1895 } |
1896 | 1896 |
1897 std::string ExtensionPrefs::GetInstallParam( | 1897 std::string ExtensionPrefs::GetInstallParam( |
1898 const std::string& extension_id) const { | 1898 const std::string& extension_id) const { |
1899 const base::DictionaryValue* extension = GetExtensionPref(extension_id); | 1899 const base::DictionaryValue* extension = GetExtensionPref(extension_id); |
1900 if (!extension) { | 1900 if (!extension) // Expected during unit testing. |
1901 NOTREACHED(); | |
1902 return std::string(); | 1901 return std::string(); |
1903 } | |
1904 std::string install_parameter; | 1902 std::string install_parameter; |
1905 if (!extension->GetString(kPrefInstallParam, &install_parameter)) | 1903 if (!extension->GetString(kPrefInstallParam, &install_parameter)) |
1906 return std::string(); | 1904 return std::string(); |
1907 return install_parameter; | 1905 return install_parameter; |
1908 } | 1906 } |
1909 | 1907 |
1910 void ExtensionPrefs::SetInstallParam(const std::string& extension_id, | 1908 void ExtensionPrefs::SetInstallParam(const std::string& extension_id, |
1911 const std::string& install_parameter) { | 1909 const std::string& install_parameter) { |
1912 UpdateExtensionPref(extension_id, | 1910 UpdateExtensionPref(extension_id, |
1913 kPrefInstallParam, | 1911 kPrefInstallParam, |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2145 } | 2143 } |
2146 bool is_incognito_enabled = IsIncognitoEnabled(extension_id); | 2144 bool is_incognito_enabled = IsIncognitoEnabled(extension_id); |
2147 | 2145 |
2148 extension_pref_value_map_->RegisterExtension( | 2146 extension_pref_value_map_->RegisterExtension( |
2149 extension_id, install_time, is_enabled, is_incognito_enabled); | 2147 extension_id, install_time, is_enabled, is_incognito_enabled); |
2150 content_settings_store_->RegisterExtension(extension_id, install_time, | 2148 content_settings_store_->RegisterExtension(extension_id, install_time, |
2151 is_enabled); | 2149 is_enabled); |
2152 } | 2150 } |
2153 | 2151 |
2154 } // namespace extensions | 2152 } // namespace extensions |
OLD | NEW |