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 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 void SetPrefInteg(const std::string& extension_id, | 733 void SetPrefInteg(const std::string& extension_id, |
734 const std::string& pref_path, | 734 const std::string& pref_path, |
735 int value) { | 735 int value) { |
736 std::string msg = " while setting: "; | 736 std::string msg = " while setting: "; |
737 msg += extension_id; | 737 msg += extension_id; |
738 msg += " "; | 738 msg += " "; |
739 msg += pref_path; | 739 msg += pref_path; |
740 msg += " = "; | 740 msg += " = "; |
741 msg += base::IntToString(value); | 741 msg += base::IntToString(value); |
742 | 742 |
743 SetPref(extension_id, pref_path, new base::FundamentalValue(value), msg); | 743 SetPref(extension_id, pref_path, new base::Value(value), msg); |
744 } | 744 } |
745 | 745 |
746 void SetPrefBool(const std::string& extension_id, | 746 void SetPrefBool(const std::string& extension_id, |
747 const std::string& pref_path, | 747 const std::string& pref_path, |
748 bool value) { | 748 bool value) { |
749 std::string msg = " while setting: "; | 749 std::string msg = " while setting: "; |
750 msg += extension_id + " " + pref_path; | 750 msg += extension_id + " " + pref_path; |
751 msg += " = "; | 751 msg += " = "; |
752 msg += (value ? "true" : "false"); | 752 msg += (value ? "true" : "false"); |
753 | 753 |
754 SetPref(extension_id, pref_path, new base::FundamentalValue(value), msg); | 754 SetPref(extension_id, pref_path, new base::Value(value), msg); |
755 } | 755 } |
756 | 756 |
757 void ClearPref(const std::string& extension_id, | 757 void ClearPref(const std::string& extension_id, |
758 const std::string& pref_path) { | 758 const std::string& pref_path) { |
759 std::string msg = " while clearing: "; | 759 std::string msg = " while clearing: "; |
760 msg += extension_id + " " + pref_path; | 760 msg += extension_id + " " + pref_path; |
761 | 761 |
762 DictionaryPrefUpdate update(profile()->GetPrefs(), "extensions.settings"); | 762 DictionaryPrefUpdate update(profile()->GetPrefs(), "extensions.settings"); |
763 base::DictionaryValue* dict = update.Get(); | 763 base::DictionaryValue* dict = update.Get(); |
764 ASSERT_TRUE(dict != NULL) << msg; | 764 ASSERT_TRUE(dict != NULL) << msg; |
(...skipping 6431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7196 shared_module->manifest()->type()); | 7196 shared_module->manifest()->type()); |
7197 EXPECT_TRUE(registry()->enabled_extensions().Contains(kExtensionId)); | 7197 EXPECT_TRUE(registry()->enabled_extensions().Contains(kExtensionId)); |
7198 | 7198 |
7199 // Reload the extension and wait for it to complete. This previously crashed | 7199 // Reload the extension and wait for it to complete. This previously crashed |
7200 // (see crbug.com/676815). | 7200 // (see crbug.com/676815). |
7201 service()->ReloadExtension(kExtensionId); | 7201 service()->ReloadExtension(kExtensionId); |
7202 base::RunLoop().RunUntilIdle(); | 7202 base::RunLoop().RunUntilIdle(); |
7203 // The shared module should be enabled. | 7203 // The shared module should be enabled. |
7204 EXPECT_TRUE(registry()->enabled_extensions().Contains(kExtensionId)); | 7204 EXPECT_TRUE(registry()->enabled_extensions().Contains(kExtensionId)); |
7205 } | 7205 } |
OLD | NEW |