| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/settings/settings_test_util.h" | 5 #include "chrome/browser/extensions/settings/settings_test_util.h" |
| 6 | 6 |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "chrome/common/extensions/extension.h" | 8 #include "chrome/common/extensions/extension.h" |
| 9 #include "chrome/browser/extensions/settings/settings_frontend.h" | 9 #include "chrome/browser/extensions/settings/settings_frontend.h" |
| 10 | 10 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 MockExtensionService::~MockExtensionService() {} | 34 MockExtensionService::~MockExtensionService() {} |
| 35 | 35 |
| 36 const Extension* MockExtensionService::GetExtensionById( | 36 const Extension* MockExtensionService::GetExtensionById( |
| 37 const std::string& id, bool include_disabled) const { | 37 const std::string& id, bool include_disabled) const { |
| 38 std::map<std::string, scoped_refptr<Extension> >::const_iterator | 38 std::map<std::string, scoped_refptr<Extension> >::const_iterator |
| 39 maybe_extension = extensions_.find(id); | 39 maybe_extension = extensions_.find(id); |
| 40 return maybe_extension == extensions_.end() ? | 40 return maybe_extension == extensions_.end() ? |
| 41 NULL : maybe_extension->second.get(); | 41 NULL : maybe_extension->second.get(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 void MockExtensionService::AddExtension( | 44 void MockExtensionService::AddExtensionWithId( |
| 45 const std::string& id, Extension::Type type) { | 45 const std::string& id, Extension::Type type) { |
| 46 DictionaryValue manifest; | 46 DictionaryValue manifest; |
| 47 manifest.SetString("name", std::string("Test extension ") + id); | 47 manifest.SetString("name", std::string("Test extension ") + id); |
| 48 manifest.SetString("version", "1.0"); | 48 manifest.SetString("version", "1.0"); |
| 49 | 49 |
| 50 switch (type) { | 50 switch (type) { |
| 51 case Extension::TYPE_EXTENSION: | 51 case Extension::TYPE_EXTENSION: |
| 52 break; | 52 break; |
| 53 | 53 |
| 54 case Extension::TYPE_PACKAGED_APP: { | 54 case Extension::TYPE_PACKAGED_APP: { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 } | 113 } |
| 114 | 114 |
| 115 SettingsStorage* ScopedSettingsStorageFactory::Create( | 115 SettingsStorage* ScopedSettingsStorageFactory::Create( |
| 116 const FilePath& base_path, const std::string& extension_id) { | 116 const FilePath& base_path, const std::string& extension_id) { |
| 117 return delegate_->Create(base_path, extension_id); | 117 return delegate_->Create(base_path, extension_id); |
| 118 } | 118 } |
| 119 | 119 |
| 120 } // namespace settings_test_util | 120 } // namespace settings_test_util |
| 121 | 121 |
| 122 } // namespace extensions | 122 } // namespace extensions |
| OLD | NEW |