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

Side by Side Diff: content/browser/renderer_host/render_message_filter.cc

Issue 8175005: When "Clear site data on exit" is checked, only pass the private mode flag to Flash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 years, 2 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
« no previous file with comments | « no previous file | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 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 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 "content/browser/renderer_host/render_message_filter.h" 5 #include "content/browser/renderer_host/render_message_filter.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 184
185 virtual int ID() OVERRIDE { 185 virtual int ID() OVERRIDE {
186 return filter()->render_process_id(); 186 return filter()->render_process_id();
187 } 187 }
188 188
189 virtual const content::ResourceContext& GetResourceContext() OVERRIDE { 189 virtual const content::ResourceContext& GetResourceContext() OVERRIDE {
190 return context_; 190 return context_;
191 } 191 }
192 192
193 virtual bool OffTheRecord() OVERRIDE { 193 virtual bool OffTheRecord() OVERRIDE {
194 return filter()->OffTheRecord(); 194 if (filter()->OffTheRecord())
195 return true;
196 if (content::GetContentClient()->browser()->AllowSaveLocalState(context_))
197 return false;
198
199 // For now, only disallow storing data for Flash <http://crbug.com/97319>.
200 for (size_t i = 0; i < info_.mime_types.size(); ++i) {
201 if (info_.mime_types[i].mime_type == "application/x-shockwave-flash")
jam 2011/10/07 16:08:02 nit: please use kFlashPluginSwfMimeType from plugi
Bernhard Bauer 2011/10/07 16:26:19 Done. Thanks for the tip!
202 return true;
203 }
204 return false;
195 } 205 }
196 206
197 virtual void SetPluginInfo(const webkit::WebPluginInfo& info) OVERRIDE { 207 virtual void SetPluginInfo(const webkit::WebPluginInfo& info) OVERRIDE {
198 info_ = info; 208 info_ = info;
199 } 209 }
200 210
201 virtual void OnFoundPluginProcessHost(PluginProcessHost* host) OVERRIDE { 211 virtual void OnFoundPluginProcessHost(PluginProcessHost* host) OVERRIDE {
202 DCHECK(host); 212 DCHECK(host);
203 host_ = host; 213 host_ = host;
204 } 214 }
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 IPC_END_MESSAGE_MAP_EX() 377 IPC_END_MESSAGE_MAP_EX()
368 378
369 return handled; 379 return handled;
370 } 380 }
371 381
372 void RenderMessageFilter::OnDestruct() const { 382 void RenderMessageFilter::OnDestruct() const {
373 BrowserThread::DeleteOnIOThread::Destruct(this); 383 BrowserThread::DeleteOnIOThread::Destruct(this);
374 } 384 }
375 385
376 bool RenderMessageFilter::OffTheRecord() const { 386 bool RenderMessageFilter::OffTheRecord() const {
377 return incognito_ || 387 return incognito_;
378 !content::GetContentClient()->browser()->AllowSaveLocalState(
379 resource_context_);
380 } 388 }
381 389
382 void RenderMessageFilter::OnMsgCreateWindow( 390 void RenderMessageFilter::OnMsgCreateWindow(
383 const ViewHostMsg_CreateWindow_Params& params, 391 const ViewHostMsg_CreateWindow_Params& params,
384 int* route_id, int64* cloned_session_storage_namespace_id) { 392 int* route_id, int64* cloned_session_storage_namespace_id) {
385 if (!content::GetContentClient()->browser()->CanCreateWindow( 393 if (!content::GetContentClient()->browser()->CanCreateWindow(
386 params.opener_url, params.window_container_type, resource_context_)) { 394 params.opener_url, params.window_container_type, resource_context_)) {
387 *route_id = MSG_ROUTING_NONE; 395 *route_id = MSG_ROUTING_NONE;
388 return; 396 return;
389 } 397 }
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 ViewHostMsg_GetRawCookies::WriteReplyParams(reply_msg, cookies); 853 ViewHostMsg_GetRawCookies::WriteReplyParams(reply_msg, cookies);
846 Send(reply_msg); 854 Send(reply_msg);
847 } 855 }
848 856
849 void RenderMessageFilter::OnCompletedOpenChannelToNpapiPlugin( 857 void RenderMessageFilter::OnCompletedOpenChannelToNpapiPlugin(
850 OpenChannelToNpapiPluginCallback* client) { 858 OpenChannelToNpapiPluginCallback* client) {
851 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 859 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
852 DCHECK(ContainsKey(plugin_host_clients_, client)); 860 DCHECK(ContainsKey(plugin_host_clients_, client));
853 plugin_host_clients_.erase(client); 861 plugin_host_clients_.erase(client);
854 } 862 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698