forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcast_browser_process.h
144 lines (117 loc) · 4.84 KB
/
cast_browser_process.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROMECAST_BROWSER_CAST_BROWSER_PROCESS_H_
#define CHROMECAST_BROWSER_CAST_BROWSER_PROCESS_H_
#include <memory>
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "build/build_config.h"
#include "chromecast/chromecast_buildflags.h"
class TtsController;
class PrefService;
namespace net {
class NetLog;
} // namespace net
namespace chromecast {
class CastService;
class CastScreen;
class CastWebViewFactory;
class ConnectivityChecker;
namespace metrics {
class CastMetricsServiceClient;
} // namespace metrics
namespace shell {
#if defined(USE_AURA) && BUILDFLAG(ENABLE_CHROMECAST_EXTENSIONS)
class AccessibilityManager;
#endif // defined(USE_AURA) && BUILDFLAG(ENABLE_CHROMECAST_EXTENSIONS)
class CastBrowserContext;
class CastContentBrowserClient;
class CastDisplayConfigurator;
class RemoteDebuggingServer;
class CastBrowserProcess {
public:
// Gets the global instance of CastBrowserProcess. Does not create lazily and
// assumes the instance already exists.
static CastBrowserProcess* GetInstance();
CastBrowserProcess();
virtual ~CastBrowserProcess();
void SetBrowserContext(std::unique_ptr<CastBrowserContext> browser_context);
void SetCastContentBrowserClient(CastContentBrowserClient* browser_client);
void SetCastService(std::unique_ptr<CastService> cast_service);
#if defined(USE_AURA)
#if BUILDFLAG(ENABLE_CHROMECAST_EXTENSIONS)
void SetAccessibilityManager(
std::unique_ptr<AccessibilityManager> accessibility_manager);
void ClearAccessibilityManager();
#endif // BUILDFLAG(ENABLE_CHROMECAST_EXTENSIONS)
void SetCastScreen(std::unique_ptr<CastScreen> cast_screen);
void SetDisplayConfigurator(
std::unique_ptr<CastDisplayConfigurator> display_configurator);
#endif // defined(USE_AURA)
void SetMetricsServiceClient(
std::unique_ptr<metrics::CastMetricsServiceClient>
metrics_service_client);
void SetPrefService(std::unique_ptr<PrefService> pref_service);
void SetRemoteDebuggingServer(
std::unique_ptr<RemoteDebuggingServer> remote_debugging_server);
void SetConnectivityChecker(
scoped_refptr<ConnectivityChecker> connectivity_checker);
void SetNetLog(net::NetLog* net_log);
void SetTtsController(std::unique_ptr<TtsController> tts_controller);
void SetWebViewFactory(CastWebViewFactory* web_view_factory);
CastContentBrowserClient* browser_client() const {
return cast_content_browser_client_;
}
CastBrowserContext* browser_context() const { return browser_context_.get(); }
CastService* cast_service() const { return cast_service_.get(); }
#if defined(USE_AURA)
CastScreen* cast_screen() const { return cast_screen_.get(); }
CastDisplayConfigurator* display_configurator() const {
return display_configurator_.get();
}
#if BUILDFLAG(ENABLE_CHROMECAST_EXTENSIONS)
AccessibilityManager* accessibility_manager() const {
return accessibility_manager_.get();
}
#endif // BUILDFLAG(ENABLE_CHROMECAST_EXTENSIONS)
#endif // defined(USE_AURA)
metrics::CastMetricsServiceClient* metrics_service_client() const {
return metrics_service_client_.get();
}
PrefService* pref_service() const { return pref_service_.get(); }
ConnectivityChecker* connectivity_checker() const {
return connectivity_checker_.get();
}
RemoteDebuggingServer* remote_debugging_server() const {
return remote_debugging_server_.get();
}
net::NetLog* net_log() const { return net_log_; }
TtsController* tts_controller() const { return tts_controller_.get(); }
CastWebViewFactory* web_view_factory() const { return web_view_factory_; }
private:
// Note: The following order should match the order they are set in
// CastBrowserMainParts.
#if defined(USE_AURA)
std::unique_ptr<CastScreen> cast_screen_;
std::unique_ptr<CastDisplayConfigurator> display_configurator_;
#if BUILDFLAG(ENABLE_CHROMECAST_EXTENSIONS)
std::unique_ptr<AccessibilityManager> accessibility_manager_;
#endif // BUILDFLAG(ENABLE_CHROMECAST_EXTENSIONS)
#endif // defined(USE_AURA)
std::unique_ptr<PrefService> pref_service_;
scoped_refptr<ConnectivityChecker> connectivity_checker_;
std::unique_ptr<CastBrowserContext> browser_context_;
std::unique_ptr<metrics::CastMetricsServiceClient> metrics_service_client_;
std::unique_ptr<RemoteDebuggingServer> remote_debugging_server_;
CastWebViewFactory* web_view_factory_ = nullptr;
CastContentBrowserClient* cast_content_browser_client_;
net::NetLog* net_log_;
std::unique_ptr<TtsController> tts_controller_;
// Note: CastService must be destroyed before others.
std::unique_ptr<CastService> cast_service_;
DISALLOW_COPY_AND_ASSIGN(CastBrowserProcess);
};
} // namespace shell
} // namespace chromecast
#endif // CHROMECAST_BROWSER_CAST_BROWSER_PROCESS_H_