summaryrefslogtreecommitdiffstats
path: root/apps/shell/common/shell_extensions_client.h
blob: 9d5e01e03a75e9b9e2e36495ebcdc4337ca3b179 (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
// Copyright 2013 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 APPS_SHELL_COMMON_SHELL_EXTENSIONS_CLIENT_H_
#define APPS_SHELL_COMMON_SHELL_EXTENSIONS_CLIENT_H_

#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "extensions/common/extensions_client.h"

namespace apps {

// The app_shell implementation of ExtensionsClient.
class ShellExtensionsClient : public extensions::ExtensionsClient {
 public:
  ShellExtensionsClient();
  virtual ~ShellExtensionsClient();

  // extensions::ExtensionsClient overrides:
  virtual void Initialize() OVERRIDE;
  virtual const extensions::PermissionsProvider& GetPermissionsProvider() const
      OVERRIDE;
  virtual const extensions::PermissionMessageProvider&
      GetPermissionMessageProvider() const OVERRIDE;
  virtual extensions::FeatureProvider* GetFeatureProviderByName(
      const std::string& name) const OVERRIDE;
  virtual void FilterHostPermissions(
      const extensions::URLPatternSet& hosts,
      extensions::URLPatternSet* new_hosts,
      std::set<extensions::PermissionMessage>* messages) const OVERRIDE;
  virtual void SetScriptingWhitelist(const ScriptingWhitelist& whitelist)
      OVERRIDE;
  virtual const ScriptingWhitelist& GetScriptingWhitelist() const OVERRIDE;
  virtual extensions::URLPatternSet GetPermittedChromeSchemeHosts(
      const extensions::Extension* extension,
      const extensions::APIPermissionSet& api_permissions) const OVERRIDE;
  virtual bool IsScriptableURL(const GURL& url, std::string* error) const
      OVERRIDE;

 private:
  ScriptingWhitelist scripting_whitelist_;

  DISALLOW_COPY_AND_ASSIGN(ShellExtensionsClient);
};

}  // namespace apps

#endif  // APPS_SHELL_COMMON_SHELL_EXTENSIONS_CLIENT_H_