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

Side by Side Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 7167007: Use empty resource identifier unless --enable-resource-content-settings is set. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 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 | « chrome/browser/content_settings/host_content_settings_map.cc ('k') | 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 "chrome/renderer/chrome_content_renderer_client.h" 5 #include "chrome/renderer/chrome_content_renderer_client.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 if (!found) 260 if (!found)
261 return NULL; 261 return NULL;
262 if (!webkit::npapi::IsPluginEnabled(info)) 262 if (!webkit::npapi::IsPluginEnabled(info))
263 return NULL; 263 return NULL;
264 264
265 const webkit::npapi::PluginGroup* group = 265 const webkit::npapi::PluginGroup* group =
266 webkit::npapi::PluginList::Singleton()->GetPluginGroup(info); 266 webkit::npapi::PluginList::Singleton()->GetPluginGroup(info);
267 DCHECK(group != NULL); 267 DCHECK(group != NULL);
268 268
269 ContentSetting plugin_setting = CONTENT_SETTING_DEFAULT; 269 ContentSetting plugin_setting = CONTENT_SETTING_DEFAULT;
270 std::string resource = group->identifier(); 270 std::string resource;
271 if (cmd->HasSwitch(switches::kEnableResourceContentSettings))
272 resource = group->identifier();
271 render_view->Send(new ViewHostMsg_GetPluginContentSetting( 273 render_view->Send(new ViewHostMsg_GetPluginContentSetting(
272 frame->top()->url(), resource, &plugin_setting)); 274 frame->top()->url(), resource, &plugin_setting));
273 DCHECK(plugin_setting != CONTENT_SETTING_DEFAULT); 275 DCHECK(plugin_setting != CONTENT_SETTING_DEFAULT);
274 276
275 WebPluginParams params(original_params); 277 WebPluginParams params(original_params);
276 for (size_t i = 0; i < info.mime_types.size(); ++i) { 278 for (size_t i = 0; i < info.mime_types.size(); ++i) {
277 if (info.mime_types[i].mime_type == actual_mime_type) { 279 if (info.mime_types[i].mime_type == actual_mime_type) {
278 AppendParams(info.mime_types[i].additional_param_names, 280 AppendParams(info.mime_types[i].additional_param_names,
279 info.mime_types[i].additional_param_values, 281 info.mime_types[i].additional_param_values,
280 &params.attributeNames, 282 &params.attributeNames,
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 return render_view->CreatePepperPlugin( 345 return render_view->CreatePepperPlugin(
344 frame, params, info.path, pepper_module.get()); 346 frame, params, info.path, pepper_module.get());
345 } 347 }
346 return NULL; 348 return NULL;
347 } 349 }
348 350
349 return render_view->CreateNPAPIPlugin( 351 return render_view->CreateNPAPIPlugin(
350 frame, params, info.path, actual_mime_type); 352 frame, params, info.path, actual_mime_type);
351 } 353 }
352 354
353 observer->DidBlockContentType(CONTENT_SETTINGS_TYPE_PLUGINS, 355 observer->DidBlockContentType(CONTENT_SETTINGS_TYPE_PLUGINS, resource);
354 cmd->HasSwitch(switches::kEnableResourceContentSettings) ?
355 resource : std::string());
356 if (plugin_setting == CONTENT_SETTING_ASK) { 356 if (plugin_setting == CONTENT_SETTING_ASK) {
357 return CreatePluginPlaceholder( 357 return CreatePluginPlaceholder(
358 render_view, frame, params, *group, IDR_CLICK_TO_PLAY_PLUGIN_HTML, 358 render_view, frame, params, *group, IDR_CLICK_TO_PLAY_PLUGIN_HTML,
359 IDS_PLUGIN_LOAD, false, true); 359 IDS_PLUGIN_LOAD, false, true);
360 } else { 360 } else {
361 return CreatePluginPlaceholder( 361 return CreatePluginPlaceholder(
362 render_view, frame, params, *group, IDR_BLOCKED_PLUGIN_HTML, 362 render_view, frame, params, *group, IDR_BLOCKED_PLUGIN_HTML,
363 IDS_PLUGIN_BLOCKED, false, true); 363 IDS_PLUGIN_BLOCKED, false, true);
364 } 364 }
365 } 365 }
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 if (old_url == new_url) { 574 if (old_url == new_url) {
575 bool is_extension_url = !!extensions->GetByURL(new_url); 575 bool is_extension_url = !!extensions->GetByURL(new_url);
576 if (is_extension_url != extension_dispatcher_->is_extension_process()) 576 if (is_extension_url != extension_dispatcher_->is_extension_process())
577 return true; 577 return true;
578 } 578 }
579 579
580 return !extensions->InSameExtent(old_url, new_url); 580 return !extensions->InSameExtent(old_url, new_url);
581 } 581 }
582 582
583 } // namespace chrome 583 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/content_settings/host_content_settings_map.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698