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

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

Issue 5699005: Policy: Re-enabled plugin still disabled (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Forgotten to upload the mergeconflict resolutions (trybots happiness aplies to this upload). Created 9 years, 11 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
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/render_view.h" 5 #include "chrome/renderer/render_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 913
914 WebPlugin* RenderView::CreatePluginNoCheck(WebFrame* frame, 914 WebPlugin* RenderView::CreatePluginNoCheck(WebFrame* frame,
915 const WebPluginParams& params) { 915 const WebPluginParams& params) {
916 webkit::npapi::WebPluginInfo info; 916 webkit::npapi::WebPluginInfo info;
917 bool found; 917 bool found;
918 ContentSetting setting; 918 ContentSetting setting;
919 std::string mime_type; 919 std::string mime_type;
920 Send(new ViewHostMsg_GetPluginInfo( 920 Send(new ViewHostMsg_GetPluginInfo(
921 params.url, frame->top()->url(), params.mimeType.utf8(), &found, 921 params.url, frame->top()->url(), params.mimeType.utf8(), &found,
922 &info, &setting, &mime_type)); 922 &info, &setting, &mime_type));
923 if (!found || !info.enabled) 923 if (!found || !webkit::npapi::IsPluginEnabled(info))
924 return NULL; 924 return NULL;
925 925
926 scoped_refptr<webkit::ppapi::PluginModule> pepper_module( 926 scoped_refptr<webkit::ppapi::PluginModule> pepper_module(
927 pepper_delegate_.CreatePepperPlugin(info.path)); 927 pepper_delegate_.CreatePepperPlugin(info.path));
928 if (pepper_module) 928 if (pepper_module)
929 return CreatePepperPlugin(frame, params, info.path, pepper_module.get()); 929 return CreatePepperPlugin(frame, params, info.path, pepper_module.get());
930 return CreateNPAPIPlugin(frame, params, info.path, mime_type); 930 return CreateNPAPIPlugin(frame, params, info.path, mime_type);
931 } 931 }
932 932
933 void RenderView::RegisterPluginDelegate(WebPluginDelegateProxy* delegate) { 933 void RenderView::RegisterPluginDelegate(WebPluginDelegateProxy* delegate) {
(...skipping 1775 matching lines...) Expand 10 before | Expand all | Expand 10 after
2709 group->GetGroupName(), 2709 group->GetGroupName(),
2710 GURL(group->GetUpdateURL()))); 2710 GURL(group->GetUpdateURL())));
2711 return CreatePluginPlaceholder(frame, 2711 return CreatePluginPlaceholder(frame,
2712 params, 2712 params,
2713 *group, 2713 *group,
2714 IDR_BLOCKED_PLUGIN_HTML, 2714 IDR_BLOCKED_PLUGIN_HTML,
2715 IDS_PLUGIN_OUTDATED, 2715 IDS_PLUGIN_OUTDATED,
2716 false); 2716 false);
2717 } 2717 }
2718 2718
2719 if (!info.enabled) 2719 if (!webkit::npapi::IsPluginEnabled(info))
2720 return NULL; 2720 return NULL;
2721 2721
2722 ContentSetting host_setting = 2722 ContentSetting host_setting =
2723 current_content_settings_.settings[CONTENT_SETTINGS_TYPE_PLUGINS]; 2723 current_content_settings_.settings[CONTENT_SETTINGS_TYPE_PLUGINS];
2724 if (info.path.value() == webkit::npapi::kDefaultPluginLibraryName || 2724 if (info.path.value() == webkit::npapi::kDefaultPluginLibraryName ||
2725 plugin_setting == CONTENT_SETTING_ALLOW || 2725 plugin_setting == CONTENT_SETTING_ALLOW ||
2726 host_setting == CONTENT_SETTING_ALLOW) { 2726 host_setting == CONTENT_SETTING_ALLOW) {
2727 // Delay loading plugins if prerendering. 2727 // Delay loading plugins if prerendering.
2728 WebDataSource* ds = frame->dataSource(); 2728 WebDataSource* ds = frame->dataSource();
2729 NavigationState* navigation_state = NavigationState::FromDataSource(ds); 2729 NavigationState* navigation_state = NavigationState::FromDataSource(ds);
(...skipping 3011 matching lines...) Expand 10 before | Expand all | Expand 10 after
5741 if (cmd == kJavaScriptStressTestSetStressRunType) { 5741 if (cmd == kJavaScriptStressTestSetStressRunType) {
5742 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param)); 5742 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param));
5743 } else if (cmd == kJavaScriptStressTestPrepareStressRun) { 5743 } else if (cmd == kJavaScriptStressTestPrepareStressRun) {
5744 v8::Testing::PrepareStressRun(param); 5744 v8::Testing::PrepareStressRun(param);
5745 } 5745 }
5746 } 5746 }
5747 5747
5748 void RenderView::OnContextMenuClosed() { 5748 void RenderView::OnContextMenuClosed() {
5749 context_menu_node_.reset(); 5749 context_menu_node_.reset();
5750 } 5750 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698