| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/protector/mock_protector_service.h" | 5 #include "chrome/browser/protector/mock_protector_service.h" |
| 6 | 6 |
| 7 #include "chrome/browser/protector/protector_service_factory.h" | 7 #include "chrome/browser/protector/protector_service_factory.h" |
| 8 #include "googleurl/src/gurl.h" | 8 #include "googleurl/src/gurl.h" |
| 9 | 9 |
| 10 namespace protector { | 10 namespace protector { |
| 11 | 11 |
| 12 namespace { | 12 namespace { |
| 13 | 13 |
| 14 ProfileKeyedBase* BuildMockProtectorService(Profile* profile) { | 14 ProfileKeyedService* BuildMockProtectorService(Profile* profile) { |
| 15 return new MockProtectorService(profile); | 15 return new MockProtectorService(profile); |
| 16 } | 16 } |
| 17 | 17 |
| 18 } // namespace | 18 } // namespace |
| 19 | 19 |
| 20 // static | 20 // static |
| 21 MockProtectorService* MockProtectorService::BuildForProfile(Profile* profile) { | 21 MockProtectorService* MockProtectorService::BuildForProfile(Profile* profile) { |
| 22 return static_cast<MockProtectorService*>( | 22 return static_cast<MockProtectorService*>( |
| 23 ProtectorServiceFactory::GetInstance()->SetTestingFactoryAndUse( | 23 ProtectorServiceFactory::GetInstance()->SetTestingFactoryAndUse( |
| 24 profile, BuildMockProtectorService)); | 24 profile, BuildMockProtectorService)); |
| 25 } | 25 } |
| 26 | 26 |
| 27 MockProtectorService::MockProtectorService(Profile* profile) | 27 MockProtectorService::MockProtectorService(Profile* profile) |
| 28 : ProtectorService(profile) { | 28 : ProtectorService(profile) { |
| 29 } | 29 } |
| 30 | 30 |
| 31 MockProtectorService::~MockProtectorService() { | 31 MockProtectorService::~MockProtectorService() { |
| 32 } | 32 } |
| 33 | 33 |
| 34 } // namespace protector | 34 } // namespace protector |
| OLD | NEW |