summaryrefslogtreecommitdiffstats
path: root/chrome/browser/plugins/chrome_content_browser_client_plugins_part.h
blob: 815eafb9276847d38cd726e3fb9b05637624c866 (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// 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 CHROME_BROWSER_PLUGINS_CHROME_CONTENT_BROWSER_CLIENT_PLUGINS_PART_H_
#define CHROME_BROWSER_PLUGINS_CHROME_CONTENT_BROWSER_CLIENT_PLUGINS_PART_H_

#include "base/macros.h"
#include "chrome/browser/chrome_content_browser_client_parts.h"
#include "content/public/browser/browser_ppapi_host.h"
#include "content/public/common/socket_permission_request.h"

namespace plugins {

// Implements the plugins portion of ChromeContentBrowserClient.
class ChromeContentBrowserClientPluginsPart
    : public ChromeContentBrowserClientParts {
 public:
  ChromeContentBrowserClientPluginsPart();
  ~ChromeContentBrowserClientPluginsPart() override;

  // Corresponding to the ChromeContentBrowserClient function of the same name.
  static bool IsPluginAllowedToUseDevChannelAPIs(
      content::BrowserContext* browser_context,
      const GURL& url,
      const std::set<std::string>& allowed_dev_channel_origins);

  static bool AllowPepperSocketAPI(
      content::BrowserContext* browser_context,
      const GURL& url,
      bool private_api,
      const content::SocketPermissionRequest* params,
      const std::set<std::string>& allowed_socket_origin);

  static bool IsPluginAllowedToCallRequestOSFileHandle(
      content::BrowserContext* browser_context,
      const GURL& url,
      const std::set<std::string>& allowed_file_handle_origins);

  static void DidCreatePpapiPlugin(content::BrowserPpapiHost* browser_host);

 private:
  // ChromeContentBrowserClientParts:
  void RenderProcessWillLaunch(content::RenderProcessHost* host) override;

  DISALLOW_COPY_AND_ASSIGN(ChromeContentBrowserClientPluginsPart);
};

}  // namespace plugins

#endif  // CHROME_BROWSER_PLUGINS_CHROME_CONTENT_BROWSER_CLIENT_PLUGINS_PART_H_