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

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: Fixed unit tests. 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 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 840
841 WebPlugin* RenderView::CreatePluginNoCheck(WebFrame* frame, 841 WebPlugin* RenderView::CreatePluginNoCheck(WebFrame* frame,
842 const WebPluginParams& params) { 842 const WebPluginParams& params) {
843 webkit::npapi::WebPluginInfo info; 843 webkit::npapi::WebPluginInfo info;
844 bool found; 844 bool found;
845 ContentSetting setting; 845 ContentSetting setting;
846 std::string mime_type; 846 std::string mime_type;
847 Send(new ViewHostMsg_GetPluginInfo( 847 Send(new ViewHostMsg_GetPluginInfo(
848 params.url, frame->top()->url(), params.mimeType.utf8(), &found, 848 params.url, frame->top()->url(), params.mimeType.utf8(), &found,
849 &info, &setting, &mime_type)); 849 &info, &setting, &mime_type));
850 if (!found || !info.enabled) 850 if (!found || !webkit::npapi::IsPluginEnabled(info))
851 return NULL; 851 return NULL;
852 852
853 scoped_refptr<webkit::ppapi::PluginModule> pepper_module( 853 scoped_refptr<webkit::ppapi::PluginModule> pepper_module(
854 pepper_delegate_.CreatePepperPlugin(info.path)); 854 pepper_delegate_.CreatePepperPlugin(info.path));
855 if (pepper_module) 855 if (pepper_module)
856 return CreatePepperPlugin(frame, params, info.path, pepper_module.get()); 856 return CreatePepperPlugin(frame, params, info.path, pepper_module.get());
857 return CreateNPAPIPlugin(frame, params, info.path, mime_type); 857 return CreateNPAPIPlugin(frame, params, info.path, mime_type);
858 } 858 }
859 859
860 void RenderView::CustomMenuListenerInstall(CustomMenuListener* listening) { 860 void RenderView::CustomMenuListenerInstall(CustomMenuListener* listening) {
(...skipping 1936 matching lines...) Expand 10 before | Expand all | Expand 10 after
2797 Send(new ViewHostMsg_BlockedOutdatedPlugin(routing_id_, 2797 Send(new ViewHostMsg_BlockedOutdatedPlugin(routing_id_,
2798 group->GetGroupName(), 2798 group->GetGroupName(),
2799 GURL(group->GetUpdateURL()))); 2799 GURL(group->GetUpdateURL())));
2800 return CreatePluginPlaceholder(frame, 2800 return CreatePluginPlaceholder(frame,
2801 params, 2801 params,
2802 *group, 2802 *group,
2803 IDR_BLOCKED_PLUGIN_HTML, 2803 IDR_BLOCKED_PLUGIN_HTML,
2804 IDS_PLUGIN_OUTDATED); 2804 IDS_PLUGIN_OUTDATED);
2805 } 2805 }
2806 2806
2807 if (!info.enabled) 2807 if (!webkit::npapi::IsPluginEnabled(info))
2808 return NULL; 2808 return NULL;
2809 2809
2810 ContentSetting host_setting = 2810 ContentSetting host_setting =
2811 current_content_settings_.settings[CONTENT_SETTINGS_TYPE_PLUGINS]; 2811 current_content_settings_.settings[CONTENT_SETTINGS_TYPE_PLUGINS];
2812 if (info.path.value() == webkit::npapi::kDefaultPluginLibraryName || 2812 if (info.path.value() == webkit::npapi::kDefaultPluginLibraryName ||
2813 plugin_setting == CONTENT_SETTING_ALLOW || 2813 plugin_setting == CONTENT_SETTING_ALLOW ||
2814 host_setting == CONTENT_SETTING_ALLOW) { 2814 host_setting == CONTENT_SETTING_ALLOW) {
2815 scoped_refptr<webkit::ppapi::PluginModule> pepper_module( 2815 scoped_refptr<webkit::ppapi::PluginModule> pepper_module(
2816 pepper_delegate_.CreatePepperPlugin(info.path)); 2816 pepper_delegate_.CreatePepperPlugin(info.path));
2817 if (pepper_module) 2817 if (pepper_module)
(...skipping 2969 matching lines...) Expand 10 before | Expand all | Expand 10 after
5787 } 5787 }
5788 #endif 5788 #endif
5789 5789
5790 void RenderView::OnJavaScriptStressTestControl(int cmd, int param) { 5790 void RenderView::OnJavaScriptStressTestControl(int cmd, int param) {
5791 if (cmd == kJavaScriptStressTestSetStressRunType) { 5791 if (cmd == kJavaScriptStressTestSetStressRunType) {
5792 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param)); 5792 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param));
5793 } else if (cmd == kJavaScriptStressTestPrepareStressRun) { 5793 } else if (cmd == kJavaScriptStressTestPrepareStressRun) {
5794 v8::Testing::PrepareStressRun(param); 5794 v8::Testing::PrepareStressRun(param);
5795 } 5795 }
5796 } 5796 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698