| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 2755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2766 &actual_mime_type)); | 2766 &actual_mime_type)); |
| 2767 | 2767 |
| 2768 if (!found) | 2768 if (!found) |
| 2769 return NULL; | 2769 return NULL; |
| 2770 DCHECK(plugin_setting != CONTENT_SETTING_DEFAULT); | 2770 DCHECK(plugin_setting != CONTENT_SETTING_DEFAULT); |
| 2771 | 2771 |
| 2772 const PluginGroup* group = | 2772 const PluginGroup* group = |
| 2773 NPAPI::PluginList::Singleton()->GetPluginGroup(info); | 2773 NPAPI::PluginList::Singleton()->GetPluginGroup(info); |
| 2774 DCHECK(group != NULL); | 2774 DCHECK(group != NULL); |
| 2775 | 2775 |
| 2776 if (cmd->HasSwitch(switches::kBlockOutdatedPlugins) && | 2776 if (group->IsVulnerable() && |
| 2777 group->IsVulnerable()) { | 2777 !cmd->HasSwitch(switches::kAllowOutdatedPlugins)) { |
| 2778 Send(new ViewHostMsg_BlockedOutdatedPlugin(routing_id_, | 2778 Send(new ViewHostMsg_BlockedOutdatedPlugin(routing_id_, |
| 2779 group->GetGroupName(), | 2779 group->GetGroupName(), |
| 2780 GURL(group->GetUpdateURL()))); | 2780 GURL(group->GetUpdateURL()))); |
| 2781 return CreatePluginPlaceholder(frame, | 2781 return CreatePluginPlaceholder(frame, |
| 2782 params, | 2782 params, |
| 2783 *group, | 2783 *group, |
| 2784 IDR_BLOCKED_PLUGIN_HTML, | 2784 IDR_BLOCKED_PLUGIN_HTML, |
| 2785 IDS_PLUGIN_OUTDATED); | 2785 IDS_PLUGIN_OUTDATED); |
| 2786 } | 2786 } |
| 2787 |
| 2787 if (!info.enabled) | 2788 if (!info.enabled) |
| 2788 return NULL; | 2789 return NULL; |
| 2789 | 2790 |
| 2790 ContentSetting host_setting = | 2791 ContentSetting host_setting = |
| 2791 current_content_settings_.settings[CONTENT_SETTINGS_TYPE_PLUGINS]; | 2792 current_content_settings_.settings[CONTENT_SETTINGS_TYPE_PLUGINS]; |
| 2792 if (info.path.value() == kDefaultPluginLibraryName || | 2793 if (info.path.value() == kDefaultPluginLibraryName || |
| 2793 plugin_setting == CONTENT_SETTING_ALLOW || | 2794 plugin_setting == CONTENT_SETTING_ALLOW || |
| 2794 host_setting == CONTENT_SETTING_ALLOW) { | 2795 host_setting == CONTENT_SETTING_ALLOW) { |
| 2795 scoped_refptr<webkit::ppapi::PluginModule> pepper_module( | 2796 scoped_refptr<webkit::ppapi::PluginModule> pepper_module( |
| 2796 pepper_delegate_.CreatePepperPlugin(info.path)); | 2797 pepper_delegate_.CreatePepperPlugin(info.path)); |
| (...skipping 2956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5753 external_popup_menu_.reset(); | 5754 external_popup_menu_.reset(); |
| 5754 } | 5755 } |
| 5755 #endif | 5756 #endif |
| 5756 | 5757 |
| 5757 void RenderView::AddErrorToRootConsole(const string16& message) { | 5758 void RenderView::AddErrorToRootConsole(const string16& message) { |
| 5758 if (webview() && webview()->mainFrame()) { | 5759 if (webview() && webview()->mainFrame()) { |
| 5759 webview()->mainFrame()->addMessageToConsole( | 5760 webview()->mainFrame()->addMessageToConsole( |
| 5760 WebConsoleMessage(WebConsoleMessage::LevelError, message)); | 5761 WebConsoleMessage(WebConsoleMessage::LevelError, message)); |
| 5761 } | 5762 } |
| 5762 } | 5763 } |
| OLD | NEW |