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

Unified Diff: chrome/browser/extensions/api/streams_private/streams_resource_throttle.h

Issue 12381035: Move Mime type handling to streamsPrivate API, so that it works on Desktop Chrome. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Initialize test variable 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/streams_private/streams_resource_throttle.h
diff --git a/chrome/browser/chromeos/extensions/file_browser_resource_throttle.h b/chrome/browser/extensions/api/streams_private/streams_resource_throttle.h
similarity index 73%
rename from chrome/browser/chromeos/extensions/file_browser_resource_throttle.h
rename to chrome/browser/extensions/api/streams_private/streams_resource_throttle.h
index cf20a16971ad3473a0a49d714e911ce61836d04b..0b27b38dc10e745415c49d65ca13228b8bef6e46 100644
--- a/chrome/browser/chromeos/extensions/file_browser_resource_throttle.h
+++ b/chrome/browser/extensions/api/streams_private/streams_resource_throttle.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_RESOURCE_THROTTLE_H_
-#define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_RESOURCE_THROTTLE_H_
+#ifndef CHROME_BROWSER_EXTENSIONS_API_STREAMS_PRIVATE_STREAMS_RESOURCE_THROTTLE_H_
+#define CHROME_BROWSER_EXTENSIONS_API_STREAMS_PRIVATE_STREAMS_RESOURCE_THROTTLE_H_
#include <string>
@@ -27,15 +27,15 @@ class URLRequest;
// browser handler. It the request can be handled by a file browser handler
// extension, it gets canceled and the extension is notified to handle
// the requested URL.
-class FileBrowserResourceThrottle : public content::ResourceThrottle {
+class StreamsResourceThrottle : public content::ResourceThrottle {
public:
- // Used to dispatch fileBrowserHandler events to notify an extension it should
+ // Used to dispatch streamsPrivate events to notify an extension it should
// handle an URL request.
// Can be used on any thread. The actual dispatch tasks will be posted to the
// UI thread.
- class FileBrowserHandlerEventRouter {
+ class StreamsPrivateEventRouter {
public:
- virtual ~FileBrowserHandlerEventRouter() {}
+ virtual ~StreamsPrivateEventRouter() {}
// Used to dispatch fileBrowserHandler.onExecuteContentHandler to the
// extension with id |extension_id|. |mime_type| and |request_url| are the
@@ -51,32 +51,32 @@ class FileBrowserResourceThrottle : public content::ResourceThrottle {
const std::string& extension_id) = 0;
};
- // Creates a FileBrowserResourceThrottle for the |request|.
+ // Creates a StreamsResourceThrottle for the |request|.
// The throtlle's |mime_type_| and |url_request_| members are extracted from
// the request.
// The throttle's |event_router_| is created and set (it's a
- // FileBrowserHandlerEventRouterImpl instance; see the .cc file).
- static FileBrowserResourceThrottle* Create(
+ // StreamsHandlerEventRouterImpl instance; see the .cc file).
+ static StreamsResourceThrottle* Create(
int render_process_id,
int render_view_id,
net::URLRequest* request,
bool profile_is_incognito,
const ExtensionInfoMap* extension_info_map);
- // Creates a FileBrowserResourceThrottle to be used in a test.
+ // Creates a StreamsResourceThrottle to be used in a test.
// |event_router| can hold NULL, in which case the throttle's |event_router_|
- // member is set to a FileBrowserHandlerEventRouterImpl instance, just like in
- // FileBrowserResourceThrottle::Create.
- static FileBrowserResourceThrottle* CreateForTest(
+ // member is set to a StreamsHandlerEventRouterImpl instance, just like in
+ // StreamsResourceThrottle::Create.
+ static StreamsResourceThrottle* CreateForTest(
int render_process_id,
int renser_view_id,
const std::string& mime_type,
const GURL& request_url,
bool profile_is_incognito,
const ExtensionInfoMap* extension_info_map,
- scoped_ptr<FileBrowserHandlerEventRouter> event_router);
+ scoped_ptr<StreamsPrivateEventRouter> event_router);
- virtual ~FileBrowserResourceThrottle();
+ virtual ~StreamsResourceThrottle();
// content::ResourceThrottle implementation.
// Calls |MaybeInterceptWithExtension| for all extension_id's white-listed to
@@ -84,15 +84,15 @@ class FileBrowserResourceThrottle : public content::ResourceThrottle {
virtual void WillProcessResponse(bool* defer) OVERRIDE;
private:
- // Use Create* methods to create a FileBrowserResourceThrottle instance.
- FileBrowserResourceThrottle(
+ // Use Create* methods to create a StreamsResourceThrottle instance.
+ StreamsResourceThrottle(
int render_process_id,
int render_view_id,
const std::string& mime_type,
const GURL& request_url,
bool profile_is_incognito,
const ExtensionInfoMap* extension_info_map,
- scoped_ptr<FileBrowserHandlerEventRouter> event_router);
+ scoped_ptr<StreamsPrivateEventRouter> event_router);
// Checks if the extension has a registered file browser handler that can
// handle the request's mime_type. If this is the case, the request is
@@ -115,8 +115,8 @@ class FileBrowserResourceThrottle : public content::ResourceThrottle {
// thread.
const scoped_refptr<const ExtensionInfoMap> extension_info_map_;
- // Event router to be used to dispatch the fileBrowserHandler events.
- scoped_ptr<FileBrowserHandlerEventRouter> event_router_;
+ // Event router to be used to dispatch the streamsPrivate events.
+ scoped_ptr<StreamsPrivateEventRouter> event_router_;
};
-#endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_RESOURCE_THROTTLE_H_
+#endif // CHROME_BROWSER_EXTENSIONS_API_STREAMS_PRIVATE_STREAMS_RESOURCE_THROTTLE_H_

Powered by Google App Engine
This is Rietveld 408576698