Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / ios / chrome / browser / application_context.h
blobb7762fa700a0292e0e9f6438e3e28659f7f870a8
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
3 // found in the LICENSE file.
5 #ifndef IOS_CHROME_BROWSER_APPLICATION_CONTEXT_H_
6 #define IOS_CHROME_BROWSER_APPLICATION_CONTEXT_H_
8 #include <string>
10 #include "base/macros.h"
12 namespace ios {
13 class ChromeBrowserStateManager;
16 namespace metrics {
17 class MetricsService;
20 namespace net {
21 class URLRequestContextGetter;
24 namespace policy {
25 class BrowserPolicyConnector;
28 namespace rappor {
29 class RapporService;
32 class ApplicationContext;
33 class PrefService;
35 // Gets the global application context. Cannot return null.
36 ApplicationContext* GetApplicationContext();
38 class ApplicationContext {
39 public:
40 ApplicationContext();
41 virtual ~ApplicationContext();
43 // Gets the local state associated with this application.
44 virtual PrefService* GetLocalState() = 0;
46 // Gets the URL request context associated with this application.
47 virtual net::URLRequestContextGetter* GetSystemURLRequestContext() = 0;
49 // Gets the locale used by the application.
50 virtual const std::string& GetApplicationLocale() = 0;
52 // Gets the ChromeBrowserStateManager used by this application.
53 virtual ios::ChromeBrowserStateManager* GetChromeBrowserStateManager() = 0;
55 // Gets the MetricsService used by this application.
56 virtual metrics::MetricsService* GetMetricsService() = 0;
58 // Gets the policy connector, creating and starting it if necessary.
59 virtual policy::BrowserPolicyConnector* GetBrowserPolicyConnector() = 0;
61 // Gets the RapporService. May returns null.
62 virtual rappor::RapporService* GetRapporService() = 0;
64 protected:
65 // Sets the global ApplicationContext instance.
66 static void SetApplicationContext(ApplicationContext* context);
68 private:
69 DISALLOW_COPY_AND_ASSIGN(ApplicationContext);
72 #endif // IOS_CHROME_BROWSER_APPLICATION_CONTEXT_H_