| 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 21 matching lines...) Expand all Loading... |
| 32 MockExtensionService::~MockExtensionService() {} | 32 MockExtensionService::~MockExtensionService() {} |
| 33 | 33 |
| 34 const Extension* MockExtensionService::GetExtensionById( | 34 const Extension* MockExtensionService::GetExtensionById( |
| 35 const std::string& id, bool include_disabled) const { | 35 const std::string& id, bool include_disabled) const { |
| 36 std::map<std::string, scoped_refptr<Extension> >::const_iterator | 36 std::map<std::string, scoped_refptr<Extension> >::const_iterator |
| 37 maybe_extension = extensions_.find(id); | 37 maybe_extension = extensions_.find(id); |
| 38 return maybe_extension == extensions_.end() ? | 38 return maybe_extension == extensions_.end() ? |
| 39 NULL : maybe_extension->second.get(); | 39 NULL : maybe_extension->second.get(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 void MockExtensionService::AddExtension( | 42 void MockExtensionService::AddExtensionWithId( |
| 43 const std::string& id, Extension::Type type) { | 43 const std::string& id, Extension::Type type) { |
| 44 DictionaryValue manifest; | 44 DictionaryValue manifest; |
| 45 manifest.SetString("name", std::string("Test extension ") + id); | 45 manifest.SetString("name", std::string("Test extension ") + id); |
| 46 manifest.SetString("version", "1.0"); | 46 manifest.SetString("version", "1.0"); |
| 47 | 47 |
| 48 switch (type) { | 48 switch (type) { |
| 49 case Extension::TYPE_EXTENSION: | 49 case Extension::TYPE_EXTENSION: |
| 50 break; | 50 break; |
| 51 | 51 |
| 52 case Extension::TYPE_PACKAGED_APP: { | 52 case Extension::TYPE_PACKAGED_APP: { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 return static_cast<ExtensionService*>(as_interface); | 90 return static_cast<ExtensionService*>(as_interface); |
| 91 } | 91 } |
| 92 | 92 |
| 93 ExtensionEventRouter* MockProfile::GetExtensionEventRouter() { | 93 ExtensionEventRouter* MockProfile::GetExtensionEventRouter() { |
| 94 return event_router_.get(); | 94 return event_router_.get(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 } // namespace settings_test_util | 97 } // namespace settings_test_util |
| 98 | 98 |
| 99 } // namespace extensions | 99 } // namespace extensions |
| OLD | NEW |