Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Side by Side Diff: ios/web_view/internal/app/application_context.h

Issue 2894483003: Initialize ios/web_view translate with a system-wide URLRequestContext. (Closed)
Patch Set: Respond to comments. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698