OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_PUBLIC_PROVIDER_WEB_WEB_CONTROLLER_PROVIDER_FACTORY_H_ |
| 6 #define IOS_PUBLIC_PROVIDER_WEB_WEB_CONTROLLER_PROVIDER_FACTORY_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 namespace web { |
| 11 class BrowserState; |
| 12 } |
| 13 |
| 14 namespace ios { |
| 15 |
| 16 class WebControllerProvider; |
| 17 |
| 18 // Factory for creation of WebControllerProvider instances. |
| 19 class WebControllerProviderFactory { |
| 20 public: |
| 21 WebControllerProviderFactory(); |
| 22 virtual ~WebControllerProviderFactory(); |
| 23 |
| 24 // Vends WebControllerProviders created using |browser_state|, passing |
| 25 // ownership to callers. |
| 26 virtual std::unique_ptr<WebControllerProvider> CreateWebControllerProvider( |
| 27 web::BrowserState* browser_state); |
| 28 }; |
| 29 |
| 30 // Setter and getter for the provider factory. The provider factory should be |
| 31 // set early, before any component using WebControllerProviders is called. |
| 32 void SetWebControllerProviderFactory( |
| 33 WebControllerProviderFactory* provider_factory); |
| 34 WebControllerProviderFactory* GetWebControllerProviderFactory(); |
| 35 |
| 36 } // namespace ios |
| 37 |
| 38 #endif // IOS_PUBLIC_PROVIDER_WEB_WEB_CONTROLLER_PROVIDER_FACTORY_H_ |
OLD | NEW |