OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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_WEB_VIEW_INTERNAL_APP_APPLICATION_CONTEXT_H_ |
| 6 #define IOS_WEB_VIEW_INTERNAL_APP_APPLICATION_CONTEXT_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/macros.h" |
| 11 |
| 12 namespace net { |
| 13 class URLRequestContextGetter; |
| 14 } |
| 15 |
| 16 namespace net_log { |
| 17 class ChromeNetLog; |
| 18 } |
| 19 |
| 20 class PrefService; |
| 21 class WebViewIOThread; |
| 22 |
| 23 namespace ios_web_view { |
| 24 |
| 25 class ApplicationContext; |
| 26 |
| 27 // Gets the global application context. Cannot return null. |
| 28 ApplicationContext* GetApplicationContext(); |
| 29 |
| 30 // Defines application level globals. |
| 31 class ApplicationContext { |
| 32 public: |
| 33 // Gets the preferences associated with this application. |
| 34 virtual PrefService* GetLocalState() = 0; |
| 35 |
| 36 // Gets the URL request context associated with this application. |
| 37 virtual net::URLRequestContextGetter* GetSystemURLRequestContext() = 0; |
| 38 |
| 39 // Gets the locale used by the application. |
| 40 virtual const std::string& GetApplicationLocale() = 0; |
| 41 |
| 42 protected: |
| 43 ApplicationContext(); |
| 44 virtual ~ApplicationContext(); |
| 45 |
| 46 // Sets the global ApplicationContext instance. |
| 47 static void SetApplicationContext(ApplicationContext* context); |
| 48 |
| 49 // Gets the ChromeNetLog. |
| 50 virtual net_log::ChromeNetLog* GetNetLog() = 0; |
| 51 |
| 52 // Gets the WebViewIOThread. |
| 53 virtual WebViewIOThread* GetWebViewIOThread() = 0; |
| 54 |
| 55 private: |
| 56 DISALLOW_COPY_AND_ASSIGN(ApplicationContext); |
| 57 }; |
| 58 |
| 59 } // namespace ios_web_view |
| 60 |
| 61 #endif // IOS_WEB_VIEW_INTERNAL_APP_APPLICATION_CONTEXT_H_ |
OLD | NEW |