blob: f402fdf129820063865cdfd122e7951785b35a3c (
plain)
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
|
// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "extensions/renderer/renderer_context_data.h"
#include "base/command_line.h"
#include "base/feature_list.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "third_party/blink/public/web/blink.h"
namespace extensions {
// static
bool RendererContextData::IsIsolatedWebAppContextAndEnabled() {
return base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableIsolatedWebAppsInRenderer) &&
blink::IsIsolatedContext();
}
std::unique_ptr<ContextData> RendererContextData::Clone() const {
return std::make_unique<RendererContextData>();
}
bool RendererContextData::IsIsolatedApplication() const {
return RendererContextData::IsIsolatedWebAppContextAndEnabled();
}
} // namespace extensions
|