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 #ifndef COMPONENTS_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ | 5 #ifndef COMPONENTS_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ |
6 #define COMPONENTS_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ | 6 #define COMPONENTS_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/callback_forward.h" | 14 #include "base/callback_forward.h" |
| 15 #include "base/gtest_prod_util.h" |
15 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
16 #include "base/version.h" | 17 #include "base/version.h" |
17 #include "components/update_client/update_client.h" | 18 #include "components/update_client/update_client.h" |
18 #include "url/gurl.h" | 19 #include "url/gurl.h" |
19 | 20 |
20 class ComponentsUI; | 21 class ComponentsUI; |
21 class SupervisedUserWhitelistService; | 22 class SupervisedUserWhitelistService; |
22 | 23 |
23 namespace base { | 24 namespace base { |
24 class DictionaryValue; | 25 class DictionaryValue; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 120 |
120 virtual ~ComponentUpdateService() {} | 121 virtual ~ComponentUpdateService() {} |
121 | 122 |
122 private: | 123 private: |
123 // Returns details about registered component in the |item| parameter. The | 124 // Returns details about registered component in the |item| parameter. The |
124 // function returns true in case of success and false in case of errors. | 125 // function returns true in case of success and false in case of errors. |
125 virtual bool GetComponentDetails(const std::string& id, | 126 virtual bool GetComponentDetails(const std::string& id, |
126 CrxUpdateItem* item) const = 0; | 127 CrxUpdateItem* item) const = 0; |
127 | 128 |
128 friend class ::ComponentsUI; | 129 friend class ::ComponentsUI; |
| 130 FRIEND_TEST_ALL_PREFIXES(DefaultComponentInstallerTest, RegisterComponent); |
129 }; | 131 }; |
130 | 132 |
131 using ServiceObserver = ComponentUpdateService::Observer; | 133 using ServiceObserver = ComponentUpdateService::Observer; |
132 | 134 |
133 class OnDemandUpdater { | 135 class OnDemandUpdater { |
134 public: | 136 public: |
135 virtual ~OnDemandUpdater() {} | 137 virtual ~OnDemandUpdater() {} |
136 | 138 |
137 private: | 139 private: |
138 friend class OnDemandTester; | 140 friend class OnDemandTester; |
(...skipping 11 matching lines...) Expand all Loading... |
150 virtual bool OnDemandUpdate(const std::string& id) = 0; | 152 virtual bool OnDemandUpdate(const std::string& id) = 0; |
151 }; | 153 }; |
152 | 154 |
153 // Creates the component updater. | 155 // Creates the component updater. |
154 std::unique_ptr<ComponentUpdateService> ComponentUpdateServiceFactory( | 156 std::unique_ptr<ComponentUpdateService> ComponentUpdateServiceFactory( |
155 const scoped_refptr<Configurator>& config); | 157 const scoped_refptr<Configurator>& config); |
156 | 158 |
157 } // namespace component_updater | 159 } // namespace component_updater |
158 | 160 |
159 #endif // COMPONENTS_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ | 161 #endif // COMPONENTS_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_H_ |
OLD | NEW |