OLD | NEW |
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 2710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2721 IDR_BLOCKED_PLUGIN_HTML, | 2721 IDR_BLOCKED_PLUGIN_HTML, |
2722 IDS_PLUGIN_OUTDATED, | 2722 IDS_PLUGIN_OUTDATED, |
2723 false); | 2723 false); |
2724 } | 2724 } |
2725 | 2725 |
2726 if (!webkit::npapi::IsPluginEnabled(info)) | 2726 if (!webkit::npapi::IsPluginEnabled(info)) |
2727 return NULL; | 2727 return NULL; |
2728 | 2728 |
2729 ContentSetting host_setting = | 2729 ContentSetting host_setting = |
2730 current_content_settings_.settings[CONTENT_SETTINGS_TYPE_PLUGINS]; | 2730 current_content_settings_.settings[CONTENT_SETTINGS_TYPE_PLUGINS]; |
| 2731 |
| 2732 if (group->RequiresAuthorization() && |
| 2733 !cmd->HasSwitch(switches::kAlwaysAuthorizePlugins) && |
| 2734 (plugin_setting == CONTENT_SETTING_ALLOW || |
| 2735 plugin_setting == CONTENT_SETTING_ASK) && |
| 2736 host_setting == CONTENT_SETTING_DEFAULT) { |
| 2737 Send(new ViewHostMsg_BlockedOutdatedPlugin(routing_id_, |
| 2738 group->GetGroupName(), |
| 2739 GURL())); |
| 2740 return CreatePluginPlaceholder(frame, |
| 2741 params, |
| 2742 *group, |
| 2743 IDR_BLOCKED_PLUGIN_HTML, |
| 2744 IDS_PLUGIN_NOT_AUTHORIZED, |
| 2745 false); |
| 2746 } |
| 2747 |
2731 if (info.path.value() == webkit::npapi::kDefaultPluginLibraryName || | 2748 if (info.path.value() == webkit::npapi::kDefaultPluginLibraryName || |
2732 plugin_setting == CONTENT_SETTING_ALLOW || | 2749 plugin_setting == CONTENT_SETTING_ALLOW || |
2733 host_setting == CONTENT_SETTING_ALLOW) { | 2750 host_setting == CONTENT_SETTING_ALLOW) { |
2734 // Delay loading plugins if prerendering. | 2751 // Delay loading plugins if prerendering. |
2735 WebDataSource* ds = frame->dataSource(); | 2752 WebDataSource* ds = frame->dataSource(); |
2736 NavigationState* navigation_state = NavigationState::FromDataSource(ds); | 2753 NavigationState* navigation_state = NavigationState::FromDataSource(ds); |
2737 if (navigation_state->is_prerendering()) { | 2754 if (navigation_state->is_prerendering()) { |
2738 return CreatePluginPlaceholder(frame, | 2755 return CreatePluginPlaceholder(frame, |
2739 params, | 2756 params, |
2740 *group, | 2757 *group, |
(...skipping 3008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5749 if (cmd == kJavaScriptStressTestSetStressRunType) { | 5766 if (cmd == kJavaScriptStressTestSetStressRunType) { |
5750 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param)); | 5767 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param)); |
5751 } else if (cmd == kJavaScriptStressTestPrepareStressRun) { | 5768 } else if (cmd == kJavaScriptStressTestPrepareStressRun) { |
5752 v8::Testing::PrepareStressRun(param); | 5769 v8::Testing::PrepareStressRun(param); |
5753 } | 5770 } |
5754 } | 5771 } |
5755 | 5772 |
5756 void RenderView::OnContextMenuClosed() { | 5773 void RenderView::OnContextMenuClosed() { |
5757 context_menu_node_.reset(); | 5774 context_menu_node_.reset(); |
5758 } | 5775 } |
OLD | NEW |