| 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/extensions/extension_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 void SetPrefInteg(const std::string& extension_id, | 709 void SetPrefInteg(const std::string& extension_id, |
| 710 const std::string& pref_path, | 710 const std::string& pref_path, |
| 711 int value) { | 711 int value) { |
| 712 std::string msg = " while setting: "; | 712 std::string msg = " while setting: "; |
| 713 msg += extension_id; | 713 msg += extension_id; |
| 714 msg += " "; | 714 msg += " "; |
| 715 msg += pref_path; | 715 msg += pref_path; |
| 716 msg += " = "; | 716 msg += " = "; |
| 717 msg += base::IntToString(value); | 717 msg += base::IntToString(value); |
| 718 | 718 |
| 719 SetPref(extension_id, pref_path, new base::FundamentalValue(value), msg); | 719 SetPref(extension_id, pref_path, new base::Value(value), msg); |
| 720 } | 720 } |
| 721 | 721 |
| 722 void SetPrefBool(const std::string& extension_id, | 722 void SetPrefBool(const std::string& extension_id, |
| 723 const std::string& pref_path, | 723 const std::string& pref_path, |
| 724 bool value) { | 724 bool value) { |
| 725 std::string msg = " while setting: "; | 725 std::string msg = " while setting: "; |
| 726 msg += extension_id + " " + pref_path; | 726 msg += extension_id + " " + pref_path; |
| 727 msg += " = "; | 727 msg += " = "; |
| 728 msg += (value ? "true" : "false"); | 728 msg += (value ? "true" : "false"); |
| 729 | 729 |
| 730 SetPref(extension_id, pref_path, new base::FundamentalValue(value), msg); | 730 SetPref(extension_id, pref_path, new base::Value(value), msg); |
| 731 } | 731 } |
| 732 | 732 |
| 733 void ClearPref(const std::string& extension_id, | 733 void ClearPref(const std::string& extension_id, |
| 734 const std::string& pref_path) { | 734 const std::string& pref_path) { |
| 735 std::string msg = " while clearing: "; | 735 std::string msg = " while clearing: "; |
| 736 msg += extension_id + " " + pref_path; | 736 msg += extension_id + " " + pref_path; |
| 737 | 737 |
| 738 DictionaryPrefUpdate update(profile()->GetPrefs(), "extensions.settings"); | 738 DictionaryPrefUpdate update(profile()->GetPrefs(), "extensions.settings"); |
| 739 base::DictionaryValue* dict = update.Get(); | 739 base::DictionaryValue* dict = update.Get(); |
| 740 ASSERT_TRUE(dict != NULL) << msg; | 740 ASSERT_TRUE(dict != NULL) << msg; |
| (...skipping 6206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6947 ExtensionPrefs* prefs = ExtensionPrefs::Get(profile()); | 6947 ExtensionPrefs* prefs = ExtensionPrefs::Get(profile()); |
| 6948 EXPECT_TRUE(registry()->disabled_extensions().Contains(id)); | 6948 EXPECT_TRUE(registry()->disabled_extensions().Contains(id)); |
| 6949 EXPECT_TRUE(prefs->HasDisableReason(id, Extension::DISABLE_CORRUPTED)); | 6949 EXPECT_TRUE(prefs->HasDisableReason(id, Extension::DISABLE_CORRUPTED)); |
| 6950 | 6950 |
| 6951 base::FilePath v2_path = data_dir().AppendASCII("good2.crx"); | 6951 base::FilePath v2_path = data_dir().AppendASCII("good2.crx"); |
| 6952 UpdateExtension(id, v2_path, ENABLED); | 6952 UpdateExtension(id, v2_path, ENABLED); |
| 6953 | 6953 |
| 6954 EXPECT_FALSE(registry()->disabled_extensions().Contains(id)); | 6954 EXPECT_FALSE(registry()->disabled_extensions().Contains(id)); |
| 6955 EXPECT_FALSE(prefs->HasDisableReason(id, Extension::DISABLE_CORRUPTED)); | 6955 EXPECT_FALSE(prefs->HasDisableReason(id, Extension::DISABLE_CORRUPTED)); |
| 6956 } | 6956 } |
| OLD | NEW |