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

content / public / browser / devtools_agent_host_client.cc [blame]

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/public/browser/devtools_agent_host_client.h"

namespace content {

bool DevToolsAgentHostClient::MayAttachToRenderFrameHost(
    RenderFrameHost* render_frame_host) {
  return true;
}

bool DevToolsAgentHostClient::MayAttachToURL(const GURL& url, bool is_webui) {
  return true;
}

// Defaults to true, restricted clients must override this to false.
bool DevToolsAgentHostClient::IsTrusted() {
  return true;
}

// File access is allowed by default, only restricted clients that represent
// not entirely trusted protocol peers override this to false.
bool DevToolsAgentHostClient::MayReadLocalFiles() {
  return true;
}

bool DevToolsAgentHostClient::MayWriteLocalFiles() {
  return true;
}

bool DevToolsAgentHostClient::UsesBinaryProtocol() {
  return false;
}

// Only clients that already have powers of local code execution should override
// this to true.
bool DevToolsAgentHostClient::AllowUnsafeOperations() {
  return false;
}

std::optional<url::Origin>
DevToolsAgentHostClient::GetNavigationInitiatorOrigin() {
  return std::nullopt;
}

std::string DevToolsAgentHostClient::GetTypeForMetrics() {
  return "Other";
}

}  // namespace content