OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef COMPONENTS_PROXIMITY_AUTH_MOCK_CRYPTAUTH_CLIENT_H | 5 #ifndef COMPONENTS_PROXIMITY_AUTH_MOCK_CRYPTAUTH_CLIENT_H |
6 #define COMPONENTS_PROXIMITY_AUTH_MOCK_CRYPTAUTH_CLIENT_H | 6 #define COMPONENTS_PROXIMITY_AUTH_MOCK_CRYPTAUTH_CLIENT_H |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
10 #include "components/proximity_auth/cryptauth/cryptauth_client.h" | 10 #include "components/proximity_auth/cryptauth/cryptauth_client.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 // Represents the type of mock instances to create. | 62 // Represents the type of mock instances to create. |
63 enum class MockType { MAKE_NICE_MOCKS, MAKE_STRICT_MOCKS }; | 63 enum class MockType { MAKE_NICE_MOCKS, MAKE_STRICT_MOCKS }; |
64 | 64 |
65 // If |mock_type| is STRICT, then StrictMocks will be created. Otherwise, | 65 // If |mock_type| is STRICT, then StrictMocks will be created. Otherwise, |
66 // NiceMocks will be created. | 66 // NiceMocks will be created. |
67 explicit MockCryptAuthClientFactory(MockType mock_type); | 67 explicit MockCryptAuthClientFactory(MockType mock_type); |
68 ~MockCryptAuthClientFactory() override; | 68 ~MockCryptAuthClientFactory() override; |
69 | 69 |
70 // CryptAuthClientFactory: | 70 // CryptAuthClientFactory: |
71 scoped_ptr<CryptAuthClient> CreateInstance() override; | 71 std::unique_ptr<CryptAuthClient> CreateInstance() override; |
72 | 72 |
73 void AddObserver(Observer* observer); | 73 void AddObserver(Observer* observer); |
74 void RemoveObserver(Observer* observer); | 74 void RemoveObserver(Observer* observer); |
75 | 75 |
76 private: | 76 private: |
77 // Whether to create StrictMocks or NiceMocks. | 77 // Whether to create StrictMocks or NiceMocks. |
78 const MockType mock_type_; | 78 const MockType mock_type_; |
79 | 79 |
80 // Observers of the factory. | 80 // Observers of the factory. |
81 base::ObserverList<Observer> observer_list_; | 81 base::ObserverList<Observer> observer_list_; |
82 | 82 |
83 DISALLOW_COPY_AND_ASSIGN(MockCryptAuthClientFactory); | 83 DISALLOW_COPY_AND_ASSIGN(MockCryptAuthClientFactory); |
84 }; | 84 }; |
85 | 85 |
86 } // namespace proximity_auth | 86 } // namespace proximity_auth |
87 | 87 |
88 #endif // COMPONENTS_PROXIMITY_AUTH_MOCK_CRYPTAUTH_CLIENT_H | 88 #endif // COMPONENTS_PROXIMITY_AUTH_MOCK_CRYPTAUTH_CLIENT_H |
OLD | NEW |