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

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

Issue 6350010: Put some plug-ins behind an infobar, where they have:... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 2687 matching lines...) Expand 10 before | Expand all | Expand 10 after
2698 2698
2699 if (!found) 2699 if (!found)
2700 return NULL; 2700 return NULL;
2701 DCHECK(plugin_setting != CONTENT_SETTING_DEFAULT); 2701 DCHECK(plugin_setting != CONTENT_SETTING_DEFAULT);
2702 2702
2703 const webkit::npapi::PluginGroup* group = 2703 const webkit::npapi::PluginGroup* group =
2704 webkit::npapi::PluginList::Singleton()->GetPluginGroup(info); 2704 webkit::npapi::PluginList::Singleton()->GetPluginGroup(info);
2705 DCHECK(group != NULL); 2705 DCHECK(group != NULL);
2706 2706
2707 if (group->IsVulnerable() && 2707 if (group->IsVulnerable() &&
2708 !cmd->HasSwitch(switches::kAllowOutdatedPlugins)) { 2708 !cmd->HasSwitch(switches::kAllowOutdatedPlugins)) {
Bernhard Bauer 2011/01/24 12:56:33 What is the interaction with blocking outdated plu
2709 Send(new ViewHostMsg_BlockedOutdatedPlugin(routing_id_, 2709 Send(new ViewHostMsg_BlockedOutdatedPlugin(routing_id_,
2710 group->GetGroupName(), 2710 group->GetGroupName(),
2711 GURL(group->GetUpdateURL()))); 2711 GURL(group->GetUpdateURL())));
2712 return CreatePluginPlaceholder(frame, 2712 return CreatePluginPlaceholder(frame,
2713 params, 2713 params,
2714 *group, 2714 *group,
2715 IDR_BLOCKED_PLUGIN_HTML, 2715 IDR_BLOCKED_PLUGIN_HTML,
2716 IDS_PLUGIN_OUTDATED, 2716 IDS_PLUGIN_OUTDATED,
2717 false); 2717 false);
2718 } 2718 }
2719 2719
2720 if (!info.enabled) 2720 if (!info.enabled)
2721 return NULL; 2721 return NULL;
2722 2722
2723 ContentSetting host_setting = 2723 ContentSetting host_setting =
2724 current_content_settings_.settings[CONTENT_SETTINGS_TYPE_PLUGINS]; 2724 current_content_settings_.settings[CONTENT_SETTINGS_TYPE_PLUGINS];
2725
2726 if (group->RequiresAuthorization() &&
2727 !cmd->HasSwitch(switches::kAlwaysAuthorizePlugins) &&
2728 plugin_setting == CONTENT_SETTING_ALLOW &&
2729 host_setting == CONTENT_SETTING_DEFAULT) {
Bernhard Bauer 2011/01/24 12:56:33 Combined with the changes in HostContentSettingsMa
2730 // TODO(cevans) - may need some form of "always allow this web site",
2731 // either via an explicit button or integration with the blocked-plugin
2732 // bubble.
2733 Send(new ViewHostMsg_BlockedOutdatedPlugin(routing_id_,
2734 group->GetGroupName(),
2735 GURL()));
2736 return CreatePluginPlaceholder(frame,
2737 params,
2738 *group,
2739 IDR_BLOCKED_PLUGIN_HTML,
2740 IDS_PLUGIN_NOT_AUTHORIZED,
2741 false);
2742 }
2743
2725 if (info.path.value() == webkit::npapi::kDefaultPluginLibraryName || 2744 if (info.path.value() == webkit::npapi::kDefaultPluginLibraryName ||
2726 plugin_setting == CONTENT_SETTING_ALLOW || 2745 plugin_setting == CONTENT_SETTING_ALLOW ||
2727 host_setting == CONTENT_SETTING_ALLOW) { 2746 host_setting == CONTENT_SETTING_ALLOW) {
2728 // Delay loading plugins if prerendering. 2747 // Delay loading plugins if prerendering.
2729 WebDataSource* ds = frame->dataSource(); 2748 WebDataSource* ds = frame->dataSource();
2730 NavigationState* navigation_state = NavigationState::FromDataSource(ds); 2749 NavigationState* navigation_state = NavigationState::FromDataSource(ds);
2731 if (navigation_state->is_prerendering()) { 2750 if (navigation_state->is_prerendering()) {
2732 return CreatePluginPlaceholder(frame, 2751 return CreatePluginPlaceholder(frame,
2733 params, 2752 params,
2734 *group, 2753 *group,
(...skipping 3012 matching lines...) Expand 10 before | Expand all | Expand 10 after
5747 if (cmd == kJavaScriptStressTestSetStressRunType) { 5766 if (cmd == kJavaScriptStressTestSetStressRunType) {
5748 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param)); 5767 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param));
5749 } else if (cmd == kJavaScriptStressTestPrepareStressRun) { 5768 } else if (cmd == kJavaScriptStressTestPrepareStressRun) {
5750 v8::Testing::PrepareStressRun(param); 5769 v8::Testing::PrepareStressRun(param);
5751 } 5770 }
5752 } 5771 }
5753 5772
5754 void RenderView::OnContextMenuClosed() { 5773 void RenderView::OnContextMenuClosed() {
5755 context_menu_node_.reset(); 5774 context_menu_node_.reset();
5756 } 5775 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698