forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcast_extensions_renderer_client.cc
45 lines (35 loc) · 1.45 KB
/
cast_extensions_renderer_client.cc
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
// Copyright 2018 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.
#include "chromecast/renderer/cast_extensions_renderer_client.h"
#include "base/memory/ptr_util.h"
#include "chromecast/renderer/cast_extensions_dispatcher_delegate.h"
#include "content/public/renderer/render_thread.h"
#include "extensions/renderer/dispatcher.h"
#include "extensions/renderer/dispatcher_delegate.h"
namespace extensions {
CastExtensionsRendererClient::CastExtensionsRendererClient()
: dispatcher_(std::make_unique<Dispatcher>(
std::make_unique<CastExtensionsDispatcherDelegate>())) {
dispatcher_->OnRenderThreadStarted(content::RenderThread::Get());
}
CastExtensionsRendererClient::~CastExtensionsRendererClient() {}
bool CastExtensionsRendererClient::IsIncognitoProcess() const {
// cast_shell doesn't support off-the-record contexts.
return false;
}
int CastExtensionsRendererClient::GetLowestIsolatedWorldId() const {
// cast_shell doesn't need to reserve world IDs for anything other than
// extensions, so we always return 1. Note that 0 is reserved for the global
// world.
return 1;
}
Dispatcher* CastExtensionsRendererClient::GetDispatcher() {
return dispatcher_.get();
}
bool CastExtensionsRendererClient::ExtensionAPIEnabledForServiceWorkerScript(
const GURL& scope,
const GURL& script_url) const {
return false;
}
} // namespace extensions