| 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/api/storage/settings_test_util.h" | 5 #include "extensions/browser/api/storage/settings_test_util.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "extensions/browser/api/storage/settings_frontend.h" | 8 #include "extensions/browser/api/storage/settings_frontend.h" |
| 9 #include "extensions/browser/extension_registry.h" | 9 #include "extensions/browser/extension_registry.h" |
| 10 #include "extensions/browser/extension_system_provider.h" | 10 #include "extensions/browser/extension_system_provider.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 MockExtensionSystem::MockExtensionSystem(Profile* profile) | 104 MockExtensionSystem::MockExtensionSystem(Profile* profile) |
| 105 : TestExtensionSystem(profile) {} | 105 : TestExtensionSystem(profile) {} |
| 106 MockExtensionSystem::~MockExtensionSystem() {} | 106 MockExtensionSystem::~MockExtensionSystem() {} |
| 107 | 107 |
| 108 EventRouter* MockExtensionSystem::event_router() { | 108 EventRouter* MockExtensionSystem::event_router() { |
| 109 if (!event_router_.get()) | 109 if (!event_router_.get()) |
| 110 event_router_.reset(new EventRouter(profile_, NULL)); | 110 event_router_.reset(new EventRouter(profile_, NULL)); |
| 111 return event_router_.get(); | 111 return event_router_.get(); |
| 112 } | 112 } |
| 113 | 113 |
| 114 BrowserContextKeyedService* BuildMockExtensionSystem( | 114 KeyedService* BuildMockExtensionSystem(content::BrowserContext* profile) { |
| 115 content::BrowserContext* profile) { | |
| 116 return new MockExtensionSystem(static_cast<Profile*>(profile)); | 115 return new MockExtensionSystem(static_cast<Profile*>(profile)); |
| 117 } | 116 } |
| 118 | 117 |
| 119 // MockProfile | 118 // MockProfile |
| 120 | 119 |
| 121 MockProfile::MockProfile(const base::FilePath& file_path) | 120 MockProfile::MockProfile(const base::FilePath& file_path) |
| 122 : TestingProfile(file_path) { | 121 : TestingProfile(file_path) { |
| 123 ExtensionsBrowserClient::Get() | 122 ExtensionsBrowserClient::Get() |
| 124 ->GetExtensionSystemFactory() | 123 ->GetExtensionSystemFactory() |
| 125 ->SetTestingFactoryAndUse(this, &BuildMockExtensionSystem); | 124 ->SetTestingFactoryAndUse(this, &BuildMockExtensionSystem); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 151 | 150 |
| 152 void ScopedSettingsStorageFactory::DeleteDatabaseIfExists( | 151 void ScopedSettingsStorageFactory::DeleteDatabaseIfExists( |
| 153 const base::FilePath& base_path, | 152 const base::FilePath& base_path, |
| 154 const std::string& extension_id) { | 153 const std::string& extension_id) { |
| 155 delegate_->DeleteDatabaseIfExists(base_path, extension_id); | 154 delegate_->DeleteDatabaseIfExists(base_path, extension_id); |
| 156 } | 155 } |
| 157 | 156 |
| 158 } // namespace settings_test_util | 157 } // namespace settings_test_util |
| 159 | 158 |
| 160 } // namespace extensions | 159 } // namespace extensions |
| OLD | NEW |