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

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: Make win and mac compilers happy. 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 1771 matching lines...) Expand 10 before | Expand all | Expand 10 after
2705 Send(new ViewHostMsg_BlockedOutdatedPlugin(routing_id_, 2705 Send(new ViewHostMsg_BlockedOutdatedPlugin(routing_id_,
2706 group->GetGroupName(), 2706 group->GetGroupName(),
2707 GURL(group->GetUpdateURL()))); 2707 GURL(group->GetUpdateURL())));
2708 return CreatePluginPlaceholder(frame, 2708 return CreatePluginPlaceholder(frame,
2709 params, 2709 params,
2710 *group, 2710 *group,
2711 IDR_BLOCKED_PLUGIN_HTML, 2711 IDR_BLOCKED_PLUGIN_HTML,
2712 IDS_PLUGIN_OUTDATED); 2712 IDS_PLUGIN_OUTDATED);
2713 } 2713 }
2714 2714
2715 if (!info.enabled) 2715 if (!webkit::npapi::IsPluginEnabled(info))
2716 return NULL; 2716 return NULL;
2717 2717
2718 ContentSetting host_setting = 2718 ContentSetting host_setting =
2719 current_content_settings_.settings[CONTENT_SETTINGS_TYPE_PLUGINS]; 2719 current_content_settings_.settings[CONTENT_SETTINGS_TYPE_PLUGINS];
2720 if (info.path.value() == webkit::npapi::kDefaultPluginLibraryName || 2720 if (info.path.value() == webkit::npapi::kDefaultPluginLibraryName ||
2721 plugin_setting == CONTENT_SETTING_ALLOW || 2721 plugin_setting == CONTENT_SETTING_ALLOW ||
2722 host_setting == CONTENT_SETTING_ALLOW) { 2722 host_setting == CONTENT_SETTING_ALLOW) {
2723 scoped_refptr<webkit::ppapi::PluginModule> pepper_module( 2723 scoped_refptr<webkit::ppapi::PluginModule> pepper_module(
2724 pepper_delegate_.CreatePepperPlugin(info.path)); 2724 pepper_delegate_.CreatePepperPlugin(info.path));
2725 if (pepper_module) 2725 if (pepper_module)
(...skipping 2967 matching lines...) Expand 10 before | Expand all | Expand 10 after
5693 if (cmd == kJavaScriptStressTestSetStressRunType) { 5693 if (cmd == kJavaScriptStressTestSetStressRunType) {
5694 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param)); 5694 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param));
5695 } else if (cmd == kJavaScriptStressTestPrepareStressRun) { 5695 } else if (cmd == kJavaScriptStressTestPrepareStressRun) {
5696 v8::Testing::PrepareStressRun(param); 5696 v8::Testing::PrepareStressRun(param);
5697 } 5697 }
5698 } 5698 }
5699 5699
5700 void RenderView::OnContextMenuClosed() { 5700 void RenderView::OnContextMenuClosed() {
5701 context_menu_node_.reset(); 5701 context_menu_node_.reset();
5702 } 5702 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698