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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/file_browser_action.h
===================================================================
--- chrome/common/extensions/file_browser_action.h (revision 0)
+++ chrome/common/extensions/file_browser_action.h (revision 0)
@@ -0,0 +1,66 @@
+// Copyright (c) 2011 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_COMMON_EXTENSIONS_FILE_BROWSER_ACTION_H_
+#define CHROME_COMMON_EXTENSIONS_FILE_BROWSER_ACTION_H_
+#pragma once
+
+#include <string>
+#include <vector>
+
+#include "base/basictypes.h"
+#include "chrome/common/extensions/url_pattern.h"
+#include "googleurl/src/gurl.h"
+
+class URLPattern;
+
+// ExtensionAction encapsulates the state of a browser or page action.
Aaron Boodman 2011/04/12 22:47:21 Comment needs updating.
zel 2011/04/13 17:49:55 Done.
+// Instances can have both global and per-tab state. If a property does not have
+// a per-tab value, the global value is used instead.
+class FileBrowserAction {
Aaron Boodman 2011/04/12 22:47:21 Did you look at just using ExtensionAction directl
zel 2011/04/13 17:49:55 I did. It felt way too complex for this purpose an
+ public:
+ typedef std::vector<URLPattern> PatternList;
+
+ FileBrowserAction();
+ ~FileBrowserAction();
+
+ // extension id
+ std::string extension_id() const { return extension_id_; }
+ void set_extension_id(const std::string& extension_id) {
+ extension_id_ = extension_id;
+ }
+
+ // action id
+ const std::string& id() const { return id_; }
+ void set_id(const std::string& id) { id_ = id; }
+
+ // default title
+ const std::string& default_title() const { return title_; }
Aaron Boodman 2011/04/12 22:47:21 s/default_// ?
zel 2011/04/13 17:49:55 Done.
+ void set_default_title(const std::string& title) { title_ = title; }
+
+ // File schema URL patterns.
+ const PatternList& file_url_patterns() const { return patterns_; }
+ void AddPattern(const URLPattern& pattern);
+ bool MatchesURL(const GURL& url) const;
+ void ClearPatterns();
+
+ // Action icon path.
+ const std::string default_icon_path() const { return default_icon_path_; }
+ void set_default_icon_path(const std::string& path) {
+ default_icon_path_ = path;
+ }
+
+ private:
+ // The id for the extension this action belongs to (as defined in the
+ // extension manifest).
+ std::string extension_id_;
+ std::string title_;
+ std::string default_icon_path_;
+ // The id for the FileBrowserAction, for example: "PdfFileAction".
+ std::string id_;
+ // A list of file filters.
+ PatternList patterns_;
+};
+
+#endif // CHROME_COMMON_EXTENSIONS_FILE_BROWSER_ACTION_H_
Property changes on: chrome/common/extensions/file_browser_action.h
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698