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

Unified Diff: chrome/common/extensions/manifest_handlers/mime_types_handler.h

Issue 797183005: Add a mimeHandler extension API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@streams-lifetime
Patch Set: rebase Created 5 years, 11 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/manifest_handlers/mime_types_handler.h
diff --git a/chrome/common/extensions/manifest_handlers/mime_types_handler.h b/chrome/common/extensions/manifest_handlers/mime_types_handler.h
deleted file mode 100644
index 7933ce57c79fa68ad4a5dbe2cdc9f4ada54472fa..0000000000000000000000000000000000000000
--- a/chrome/common/extensions/manifest_handlers/mime_types_handler.h
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2014 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_MANIFEST_HANDLERS_MIME_TYPES_HANDLER_H_
-#define CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_MIME_TYPES_HANDLER_H_
-
-#include <set>
-#include <string>
-#include <vector>
-
-#include "base/basictypes.h"
-#include "extensions/common/extension.h"
-#include "extensions/common/manifest_handler.h"
-
-class MimeTypesHandler {
- public:
- // Returns list of extensions' ids that are allowed to use MIME type filters.
- static std::vector<std::string> GetMIMETypeWhitelist();
-
- static MimeTypesHandler* GetHandler(const extensions::Extension* extension);
-
- MimeTypesHandler();
- ~MimeTypesHandler();
-
- // extension id
- std::string extension_id() const { return extension_id_; }
- void set_extension_id(const std::string& extension_id) {
- extension_id_ = extension_id;
- }
-
- // Adds a MIME type filter to the handler.
- void AddMIMEType(const std::string& mime_type);
- // Tests if the handler has registered a filter for the MIME type.
- bool CanHandleMIMEType(const std::string& mime_type) const;
-
- // Set the URL that will be used to handle MIME type requests.
- void set_handler_url(const std::string& handler_url) {
- handler_url_ = handler_url;
- }
- // The URL that will be used to handle MIME type requests.
- const std::string& handler_url() const { return handler_url_; }
-
- const std::set<std::string>& mime_type_set() const { return mime_type_set_; }
-
- private:
- // The id for the extension this action belongs to (as defined in the
- // extension manifest).
- std::string extension_id_;
-
- // A list of MIME type filters.
- std::set<std::string> mime_type_set_;
-
- std::string handler_url_;
-};
-
-class MimeTypesHandlerParser : public extensions::ManifestHandler {
- public:
- MimeTypesHandlerParser();
- ~MimeTypesHandlerParser() override;
-
- bool Parse(extensions::Extension* extension, base::string16* error) override;
-
- private:
- const std::vector<std::string> Keys() const override;
-};
-
-#endif // CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_MIME_TYPES_HANDLER_H_
« no previous file with comments | « chrome/common/extensions/extension_constants.cc ('k') | chrome/common/extensions/manifest_handlers/mime_types_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698