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

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

Issue 791763003: [DISCARD] While getting plug-in info, use securityOrigin() of the top level frame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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/renderer/plugins/chrome_plugin_placeholder.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/renderer/chrome_content_renderer_client.h" 5 #include "chrome/renderer/chrome_content_renderer_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/debug/crash_logging.h" 8 #include "base/debug/crash_logging.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 bool guest_view_api_available = false; 569 bool guest_view_api_available = false;
570 extension_dispatcher_->script_context_set().ForEach( 570 extension_dispatcher_->script_context_set().ForEach(
571 render_frame->GetRenderView(), 571 render_frame->GetRenderView(),
572 base::Bind(&IsGuestViewApiAvailableToScriptContext, 572 base::Bind(&IsGuestViewApiAvailableToScriptContext,
573 &guest_view_api_available)); 573 &guest_view_api_available));
574 if (guest_view_api_available) 574 if (guest_view_api_available)
575 return false; 575 return false;
576 } 576 }
577 #endif 577 #endif
578 578
579 const WebSecurityOrigin top_level_security_origin =
580 frame->top()->securityOrigin();
581 GURL top_level_frame_origin_url;
582 // TODO(lazyboy): What happens if |top_level_security_origin| is NULL?
583 if (!top_level_security_origin.isNull())
584 top_level_frame_origin_url = GURL(top_level_security_origin.toString());
585
579 ChromeViewHostMsg_GetPluginInfo_Output output; 586 ChromeViewHostMsg_GetPluginInfo_Output output;
580 #if defined(ENABLE_PLUGINS) 587 #if defined(ENABLE_PLUGINS)
581 render_frame->Send(new ChromeViewHostMsg_GetPluginInfo( 588 render_frame->Send(new ChromeViewHostMsg_GetPluginInfo(
582 render_frame->GetRoutingID(), GURL(params.url), 589 render_frame->GetRoutingID(), GURL(params.url),
583 frame->top()->document().url(), orig_mime_type, &output)); 590 top_level_frame_origin_url, orig_mime_type, &output));
584 591
585 if (output.plugin.type == content::WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN) 592 if (output.plugin.type == content::WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN)
586 return false; 593 return false;
587 #else 594 #else
588 output.status.value = ChromeViewHostMsg_GetPluginInfo_Status::kNotFound; 595 output.status.value = ChromeViewHostMsg_GetPluginInfo_Status::kNotFound;
589 #endif 596 #endif
590 *plugin = CreatePlugin(render_frame, frame, params, output); 597 *plugin = CreatePlugin(render_frame, frame, params, output);
591 return true; 598 return true;
592 } 599 }
593 600
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after
1570 if (mime_type == content::kBrowserPluginMimeType) { 1577 if (mime_type == content::kBrowserPluginMimeType) {
1571 return new extensions::ExtensionsGuestViewContainer(render_frame); 1578 return new extensions::ExtensionsGuestViewContainer(render_frame);
1572 } else { 1579 } else {
1573 return new extensions::MimeHandlerViewContainer( 1580 return new extensions::MimeHandlerViewContainer(
1574 render_frame, mime_type, original_url); 1581 render_frame, mime_type, original_url);
1575 } 1582 }
1576 #else 1583 #else
1577 return NULL; 1584 return NULL;
1578 #endif 1585 #endif
1579 } 1586 }
OLDNEW
« no previous file with comments | « no previous file | chrome/renderer/plugins/chrome_plugin_placeholder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698