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

Side by Side Diff: chrome/common/extensions/api/url_handlers/url_handlers_parser.h

Issue 22944002: Implementation of the "Redirect URLs to Packaged Apps" feature. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 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_API_URL_HANDLERS_URL_HANDLERS_PARSER_H_
6 #define CHROME_COMMON_EXTENSIONS_API_URL_HANDLERS_URL_HANDLERS_PARSER_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "chrome/common/extensions/extension.h"
12 #include "chrome/common/extensions/manifest_handler.h"
13 #include "extensions/common/url_pattern.h"
14
15 namespace extensions {
16
17 struct UrlHandlerInfo {
18 UrlHandlerInfo();
19 ~UrlHandlerInfo();
20
21 // ID identifying this handler in the manifest.
22 std::string id;
23 // Handler title to display in all relevant UI.
24 std::string title;
25 // URL patterns associated with this handler.
26 URLPatternSet patterns;
27
28 // Convenience back-reference to the parent app.
29 const Extension* app;
30 };
31
32 struct UrlHandlers : public Extension::ManifestData {
33 UrlHandlers();
34 virtual ~UrlHandlers();
35
36 static const std::vector<UrlHandlerInfo>* GetUrlHandlers(
37 const Extension* extension);
38
39 std::vector<UrlHandlerInfo> handlers;
40 };
41
42 // Parses the "url_handlers" manifest key.
43 class UrlHandlersParser : public ManifestHandler {
44 public:
45 UrlHandlersParser();
46 virtual ~UrlHandlersParser();
47
48 // ManifestHandler API
49 virtual bool Parse(Extension* extension, string16* error) OVERRIDE;
50
51 private:
52 virtual const std::vector<std::string> Keys() const OVERRIDE;
53
54 DISALLOW_COPY_AND_ASSIGN(UrlHandlersParser);
55 };
56
57 } // namespace extensions
58
59 #endif // CHROME_COMMON_EXTENSIONS_API_URL_HANDLERS_URL_HANDLERS_PARSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698