Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: chrome/common/extensions/sandboxed_handler.h

Issue 12886023: Remove SandboxedPages and SandboxedCSP from Extension Class (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_COMMON_EXTENSIONS_SANDBOXED_HANDLER_H_
6 #define CHROME_COMMON_EXTENSIONS_SANDBOXED_HANDLER_H_
7
8 #include <string>
9
10 #include "chrome/common/extensions/extension.h"
11 #include "chrome/common/extensions/manifest_handler.h"
12 #include "extensions/common/url_pattern_set.h"
13
14 namespace extensions {
15
16 struct SandboxedInfo : public Extension::ManifestData {
Yoyo Zhou 2013/03/20 22:53:53 I'd prefer a name like SandboxedPageInfo. Since m
Devlin 2013/03/23 22:26:25 Done.
17 public:
18 SandboxedInfo();
19 virtual ~SandboxedInfo();
20
21 // Returns the extension's Content Security Policy for the sandboxed pages.
22 static const std::string& GetContentSecurityPolicy(
23 const Extension* extension);
24
25 // Returns the extension's sandboxed pages.
26 static const URLPatternSet& GetPages(const Extension* extension);
27
28 // Returns true if the specified page is sandboxed (served in a unique
29 // origin).
Yoyo Zhou 2013/03/20 22:53:53 either "...with a different CSP" or delete the par
Devlin 2013/03/23 22:26:25 Done.
30 static bool IsSandboxedPage(const Extension* extension,
31 const std::string& relative_path);
32
33 // Optional list of extension pages that are sandboxed (served from a unique
34 // origin with a different Content Security Policy).
35 URLPatternSet pages;
36
37 // Content Security Policy that should be used to enforce the sandbox used
38 // by sandboxed pages (guaranteed to have the "sandbox" directive without the
39 // "allow-same-origin" token).
40 std::string content_security_policy;
41 };
42
43 class SandboxedHandler : public ManifestHandler {
44 public:
45 SandboxedHandler();
46 virtual ~SandboxedHandler();
47
48 virtual bool Parse(Extension* extension, string16* error) OVERRIDE;
49
50 private:
51 virtual const std::vector<std::string> Keys() const OVERRIDE;
52 };
53
54 } // namespace extensions
55
56 #endif // CHROME_COMMON_EXTENSIONS_SANDBOXED_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698