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

Side by Side Diff: chrome/browser/chromeos/extensions/file_browser_resource_throttle.cc

Issue 12212031: Add support for redirecting ResourceHandlers to a blob: URL (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Code review fixes Created 7 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/file_browser_resource_throttle_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/extensions/file_browser_resource_throttle.h" 5 #include "chrome/browser/chromeos/extensions/file_browser_resource_throttle.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 81 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
82 82
83 Profile* profile = GetProfile(render_process_id, render_view_id); 83 Profile* profile = GetProfile(render_process_id, render_view_id);
84 if (!profile) 84 if (!profile)
85 return; 85 return;
86 86
87 // Create the event's arguments value. 87 // Create the event's arguments value.
88 scoped_ptr<ListValue> event_args(new ListValue()); 88 scoped_ptr<ListValue> event_args(new ListValue());
89 event_args->Append(new base::StringValue(mime_type)); 89 event_args->Append(new base::StringValue(mime_type));
90 event_args->Append(new base::StringValue(request_url.spec())); 90 event_args->Append(new base::StringValue(request_url.spec()));
91 event_args->Append(new base::StringValue(request_url.spec()));
91 92
92 scoped_ptr<Event> event(new Event(kOnExecuteContentHandlerEvent, 93 scoped_ptr<Event> event(new Event(kOnExecuteContentHandlerEvent,
93 event_args.Pass())); 94 event_args.Pass()));
94 95
95 ExtensionSystem::Get(profile)->event_router()->DispatchEventToExtension( 96 ExtensionSystem::Get(profile)->event_router()->DispatchEventToExtension(
96 extension_id, event.Pass()); 97 extension_id, event.Pass());
97 } 98 }
98 99
99 // Default implementation of FileBrowserHandlerEventRouter. 100 // Default implementation of FileBrowserHandlerEventRouter.
100 class FileBrowserHandlerEventRouterImpl 101 class FileBrowserHandlerEventRouterImpl
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 } 200 }
200 201
201 if (CanHandleMimeType(extension, mime_type_)) { 202 if (CanHandleMimeType(extension, mime_type_)) {
202 event_router_->DispatchMimeTypeHandlerEvent(render_process_id_, 203 event_router_->DispatchMimeTypeHandlerEvent(render_process_id_,
203 render_view_id_, mime_type_, request_url_, extension->id()); 204 render_view_id_, mime_type_, request_url_, extension->id());
204 controller()->CancelAndIgnore(); 205 controller()->CancelAndIgnore();
205 return true; 206 return true;
206 } 207 }
207 return false; 208 return false;
208 } 209 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/file_browser_resource_throttle_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698