forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
web_runtime_application.h
54 lines (43 loc) · 2.17 KB
/
web_runtime_application.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
// Copyright 2021 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_CAST_CORE_WEB_RUNTIME_APPLICATION_H_
#define CHROMECAST_CAST_CORE_WEB_RUNTIME_APPLICATION_H_
#include "chromecast/browser/cast_web_contents.h"
#include "chromecast/browser/cast_web_contents_observer.h"
#include "chromecast/cast_core/runtime_application_base.h"
namespace chromecast {
class BindingsManagerWebRuntime;
class CastWebService;
class UrlRewriteRulesAdapter;
class WebRuntimeApplication final : public RuntimeApplicationBase,
public CastWebContentsObserver {
public:
// |web_service| is expected to exist for the lifetime of this instance.
WebRuntimeApplication(CastWebService* web_service,
scoped_refptr<base::SequencedTaskRunner> task_runner);
~WebRuntimeApplication() override;
private:
// RuntimeApplicationBase implementation:
void HandleMessage(const cast::web::Message& message,
cast::web::MessagePortStatus* response) override;
bool Load(const cast::runtime::LoadApplicationRequest& request) override;
void SetUrlRewriteRules(const cast::v2::SetUrlRewriteRulesRequest& request,
cast::v2::SetUrlRewriteRulesResponse* response,
GrpcMethod* callback) override;
CastWebView::Scoped CreateWebView(
CoreApplicationServiceGrpc* grpc_stub) override;
GURL ProcessWebView(CoreApplicationServiceGrpc* grpc_stub,
CastWebContents* cast_web_contents) override;
// CastWebContentsObserver implementation:
void RenderFrameCreated(int render_process_id,
int render_frame_id,
mojo::PendingAssociatedRemote<
chromecast::mojom::IdentificationSettingsManager>
settings_manager) override;
std::string app_url_;
std::unique_ptr<BindingsManagerWebRuntime> bindings_manager_;
std::unique_ptr<UrlRewriteRulesAdapter> url_rewrite_adapter_;
};
} // namespace chromecast
#endif // CHROMECAST_CAST_CORE_WEB_RUNTIME_APPLICATION_H_