Chromium Code Reviews| 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 2707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2718 IDR_BLOCKED_PLUGIN_HTML, | 2718 IDR_BLOCKED_PLUGIN_HTML, |
| 2719 IDS_PLUGIN_OUTDATED, | 2719 IDS_PLUGIN_OUTDATED, |
| 2720 false); | 2720 false); |
| 2721 } | 2721 } |
| 2722 | 2722 |
| 2723 if (!webkit::npapi::IsPluginEnabled(info)) | 2723 if (!webkit::npapi::IsPluginEnabled(info)) |
| 2724 return NULL; | 2724 return NULL; |
| 2725 | 2725 |
| 2726 ContentSetting host_setting = | 2726 ContentSetting host_setting = |
| 2727 current_content_settings_.settings[CONTENT_SETTINGS_TYPE_PLUGINS]; | 2727 current_content_settings_.settings[CONTENT_SETTINGS_TYPE_PLUGINS]; |
| 2728 | |
| 2729 if (group->RequiresAuthorization() && | |
| 2730 !cmd->HasSwitch(switches::kAlwaysAuthorizePlugins) && | |
| 2731 (plugin_setting == CONTENT_SETTING_ALLOW || | |
| 2732 plugin_setting == CONTENT_SETTING_ASK) && | |
| 2733 host_setting == CONTENT_SETTING_DEFAULT) { | |
| 2734 // TODO(cevans) - may need some form of "always allow this web site", | |
| 2735 // either via an explicit button or integration with the blocked-plugin | |
| 2736 // bubble. | |
|
Bernhard Bauer
2011/01/26 12:49:25
Nit: Comment unnecessary?
| |
| 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 | |
| 2728 if (info.path.value() == webkit::npapi::kDefaultPluginLibraryName || | 2748 if (info.path.value() == webkit::npapi::kDefaultPluginLibraryName || |
| 2729 plugin_setting == CONTENT_SETTING_ALLOW || | 2749 plugin_setting == CONTENT_SETTING_ALLOW || |
| 2730 host_setting == CONTENT_SETTING_ALLOW) { | 2750 host_setting == CONTENT_SETTING_ALLOW) { |
| 2731 // Delay loading plugins if prerendering. | 2751 // Delay loading plugins if prerendering. |
| 2732 WebDataSource* ds = frame->dataSource(); | 2752 WebDataSource* ds = frame->dataSource(); |
| 2733 NavigationState* navigation_state = NavigationState::FromDataSource(ds); | 2753 NavigationState* navigation_state = NavigationState::FromDataSource(ds); |
| 2734 if (navigation_state->is_prerendering()) { | 2754 if (navigation_state->is_prerendering()) { |
| 2735 return CreatePluginPlaceholder(frame, | 2755 return CreatePluginPlaceholder(frame, |
| 2736 params, | 2756 params, |
| 2737 *group, | 2757 *group, |
| (...skipping 3012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5750 if (cmd == kJavaScriptStressTestSetStressRunType) { | 5770 if (cmd == kJavaScriptStressTestSetStressRunType) { |
| 5751 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param)); | 5771 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param)); |
| 5752 } else if (cmd == kJavaScriptStressTestPrepareStressRun) { | 5772 } else if (cmd == kJavaScriptStressTestPrepareStressRun) { |
| 5753 v8::Testing::PrepareStressRun(param); | 5773 v8::Testing::PrepareStressRun(param); |
| 5754 } | 5774 } |
| 5755 } | 5775 } |
| 5756 | 5776 |
| 5757 void RenderView::OnContextMenuClosed() { | 5777 void RenderView::OnContextMenuClosed() { |
| 5758 context_menu_node_.reset(); | 5778 context_menu_node_.reset(); |
| 5759 } | 5779 } |
| OLD | NEW |