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

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

Issue 6749021: Added new fileBrowserPrivate and fileHandler extension APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2011 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_FILE_BROWSER_ACTION_H_
6 #define CHROME_COMMON_EXTENSIONS_FILE_BROWSER_ACTION_H_
7 #pragma once
8
9 #include <string>
10 #include <vector>
11
12 #include "base/basictypes.h"
13 #include "chrome/common/extensions/url_pattern.h"
14 #include "googleurl/src/gurl.h"
15
16 class URLPattern;
17
18 // FileBrowserAction encapsulates the state of a file browser action.
19 class FileBrowserAction {
Aaron Boodman 2011/04/13 18:08:03 FileBrowserHandler
zel 2011/04/14 21:58:05 Done.
20 public:
21 typedef std::vector<URLPattern> PatternList;
22
23 FileBrowserAction();
24 ~FileBrowserAction();
25
26 // extension id
27 std::string extension_id() const { return extension_id_; }
28 void set_extension_id(const std::string& extension_id) {
29 extension_id_ = extension_id;
30 }
31
32 // action id
33 const std::string& id() const { return id_; }
34 void set_id(const std::string& id) { id_ = id; }
35
36 // default title
37 const std::string& title() const { return title_; }
38 void set_title(const std::string& title) { title_ = title; }
39
40 // File schema URL patterns.
41 const PatternList& file_url_patterns() const { return patterns_; }
42 void AddPattern(const URLPattern& pattern);
43 bool MatchesURL(const GURL& url) const;
44 void ClearPatterns();
45
46 // Action icon path.
47 const std::string icon_path() const { return default_icon_path_; }
48 void set_icon_path(const std::string& path) {
49 default_icon_path_ = path;
50 }
51
52 private:
53 // The id for the extension this action belongs to (as defined in the
54 // extension manifest).
55 std::string extension_id_;
56 std::string title_;
57 std::string default_icon_path_;
58 // The id for the FileBrowserAction, for example: "PdfFileAction".
59 std::string id_;
60 // A list of file filters.
61 PatternList patterns_;
62 };
63
64 #endif // CHROME_COMMON_EXTENSIONS_FILE_BROWSER_ACTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698