#ifndef IOS_CHROME_BROWSER_APPLICATION_CONTEXT_APPLICATION_CONTEXT_H_
#define IOS_CHROME_BROWSER_APPLICATION_CONTEXT_APPLICATION_CONTEXT_H_
#import <Foundation/Foundation.h>
#include <string>
#include "base/memory/scoped_refptr.h"
namespace component_updater {
class ComponentUpdateService;
}
namespace gcm {
class GCMDriver;
}
namespace ios {
class ChromeBrowserStateManager;
}
namespace metrics {
class MetricsService;
}
namespace metrics_services_manager {
class MetricsServicesManager;
}
namespace net {
class NetLog;
class URLRequestContextGetter;
}
namespace net_log {
class NetExportFileWriter;
}
namespace network {
class NetworkConnectionTracker;
class SharedURLLoaderFactory;
namespace mojom {
class NetworkContext;
}
}
namespace network_time {
class NetworkTimeTracker;
}
namespace segmentation_platform {
class OTRWebStateObserver;
}
namespace ukm {
class UkmRecorder;
}
namespace variations {
class VariationsService;
}
class ApplicationContext;
class BrowserPolicyConnectorIOS;
class IOSChromeIOThread;
class PrefService;
class PushNotificationService;
class SafeBrowsingService;
@protocol SingleSignOnService;
class SystemIdentityManager;
ApplicationContext* GetApplicationContext();
class ApplicationContext {
public:
ApplicationContext();
ApplicationContext(const ApplicationContext&) = delete;
ApplicationContext& operator=(const ApplicationContext&) = delete;
virtual ~ApplicationContext();
virtual void OnAppEnterForeground() = 0;
virtual void OnAppEnterBackground() = 0;
virtual bool WasLastShutdownClean() = 0;
virtual PrefService* GetLocalState() = 0;
virtual net::URLRequestContextGetter* GetSystemURLRequestContext() = 0;
virtual scoped_refptr<network::SharedURLLoaderFactory>
GetSharedURLLoaderFactory() = 0;
virtual network::mojom::NetworkContext* GetSystemNetworkContext() = 0;
virtual const std::string& GetApplicationLocale() = 0;
virtual const std::string& GetApplicationCountry() = 0;
virtual ios::ChromeBrowserStateManager* GetChromeBrowserStateManager() = 0;
virtual metrics_services_manager::MetricsServicesManager*
GetMetricsServicesManager() = 0;
virtual metrics::MetricsService* GetMetricsService() = 0;
virtual ukm::UkmRecorder* GetUkmRecorder() = 0;
virtual variations::VariationsService* GetVariationsService() = 0;
virtual net::NetLog* GetNetLog() = 0;
virtual net_log::NetExportFileWriter* GetNetExportFileWriter() = 0;
virtual network_time::NetworkTimeTracker* GetNetworkTimeTracker() = 0;
virtual IOSChromeIOThread* GetIOSChromeIOThread() = 0;
virtual gcm::GCMDriver* GetGCMDriver() = 0;
virtual component_updater::ComponentUpdateService*
GetComponentUpdateService() = 0;
virtual SafeBrowsingService* GetSafeBrowsingService() = 0;
virtual network::NetworkConnectionTracker* GetNetworkConnectionTracker() = 0;
virtual BrowserPolicyConnectorIOS* GetBrowserPolicyConnector() = 0;
virtual id<SingleSignOnService> GetSSOService() = 0;
virtual SystemIdentityManager* GetSystemIdentityManager() = 0;
virtual segmentation_platform::OTRWebStateObserver*
GetSegmentationOTRWebStateObserver() = 0;
virtual PushNotificationService* GetPushNotificationService() = 0;
protected:
static void SetApplicationContext(ApplicationContext* context);
};
#endif