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 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 // Plugins start assuming the content has focus (so that they work in | 879 // Plugins start assuming the content has focus (so that they work in |
880 // environments where RenderView isn't hosting them), so we always have to | 880 // environments where RenderView isn't hosting them), so we always have to |
881 // set the initial state. See webplugin_delegate_impl.h for details. | 881 // set the initial state. See webplugin_delegate_impl.h for details. |
882 delegate->SetContentAreaFocus(has_focus()); | 882 delegate->SetContentAreaFocus(has_focus()); |
883 } | 883 } |
884 | 884 |
885 void RenderView::UnregisterPluginDelegate(WebPluginDelegateProxy* delegate) { | 885 void RenderView::UnregisterPluginDelegate(WebPluginDelegateProxy* delegate) { |
886 plugin_delegates_.erase(delegate); | 886 plugin_delegates_.erase(delegate); |
887 } | 887 } |
888 | 888 |
| 889 void RenderView::RegisterBlockedPlugin(BlockedPlugin* blocked_plugin) { |
| 890 blocked_plugins_.insert(blocked_plugin); |
| 891 } |
| 892 |
| 893 void RenderView::UnregisterBlockedPlugin(BlockedPlugin* blocked_plugin) { |
| 894 blocked_plugins_.erase(blocked_plugin); |
| 895 } |
| 896 |
889 void RenderView::Init(gfx::NativeViewId parent_hwnd, | 897 void RenderView::Init(gfx::NativeViewId parent_hwnd, |
890 int32 opener_id, | 898 int32 opener_id, |
891 const RendererPreferences& renderer_prefs, | 899 const RendererPreferences& renderer_prefs, |
892 SharedRenderViewCounter* counter, | 900 SharedRenderViewCounter* counter, |
893 int32 routing_id, | 901 int32 routing_id, |
894 const string16& frame_name) { | 902 const string16& frame_name) { |
895 DCHECK(!webview()); | 903 DCHECK(!webview()); |
896 | 904 |
897 if (opener_id != MSG_ROUTING_NONE) | 905 if (opener_id != MSG_ROUTING_NONE) |
898 opener_id_ = opener_id; | 906 opener_id_ = opener_id; |
(...skipping 3864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4763 translate_helper_.RevertTranslation(page_id); | 4771 translate_helper_.RevertTranslation(page_id); |
4764 } | 4772 } |
4765 | 4773 |
4766 void RenderView::OnInstallMissingPlugin() { | 4774 void RenderView::OnInstallMissingPlugin() { |
4767 // This could happen when the first default plugin is deleted. | 4775 // This could happen when the first default plugin is deleted. |
4768 if (first_default_plugin_) | 4776 if (first_default_plugin_) |
4769 first_default_plugin_->InstallMissingPlugin(); | 4777 first_default_plugin_->InstallMissingPlugin(); |
4770 } | 4778 } |
4771 | 4779 |
4772 void RenderView::OnLoadBlockedPlugins() { | 4780 void RenderView::OnLoadBlockedPlugins() { |
4773 current_content_settings_.settings[CONTENT_SETTINGS_TYPE_PLUGINS] = | 4781 while (!blocked_plugins_.empty()) |
4774 CONTENT_SETTING_ALLOW; | 4782 (*blocked_plugins_.begin())->LoadPlugin(); |
4775 NotificationService::current()->Notify(NotificationType::SHOULD_LOAD_PLUGINS, | |
4776 Source<RenderView>(this), | |
4777 NotificationService::NoDetails()); | |
4778 } | 4783 } |
4779 | 4784 |
4780 void RenderView::OnFileChooserResponse(const std::vector<FilePath>& paths) { | 4785 void RenderView::OnFileChooserResponse(const std::vector<FilePath>& paths) { |
4781 // This could happen if we navigated to a different page before the user | 4786 // This could happen if we navigated to a different page before the user |
4782 // closed the chooser. | 4787 // closed the chooser. |
4783 if (file_chooser_completions_.empty()) | 4788 if (file_chooser_completions_.empty()) |
4784 return; | 4789 return; |
4785 | 4790 |
4786 WebVector<WebString> ws_file_names(paths.size()); | 4791 WebVector<WebString> ws_file_names(paths.size()); |
4787 for (size_t i = 0; i < paths.size(); ++i) | 4792 for (size_t i = 0; i < paths.size(); ++i) |
(...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5774 } | 5779 } |
5775 #endif | 5780 #endif |
5776 | 5781 |
5777 void RenderView::OnJavaScriptStressTestControl(int cmd, int param) { | 5782 void RenderView::OnJavaScriptStressTestControl(int cmd, int param) { |
5778 if (cmd == kJavaScriptStressTestSetStressRunType) { | 5783 if (cmd == kJavaScriptStressTestSetStressRunType) { |
5779 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param)); | 5784 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param)); |
5780 } else if (cmd == kJavaScriptStressTestPrepareStressRun) { | 5785 } else if (cmd == kJavaScriptStressTestPrepareStressRun) { |
5781 v8::Testing::PrepareStressRun(param); | 5786 v8::Testing::PrepareStressRun(param); |
5782 } | 5787 } |
5783 } | 5788 } |
OLD | NEW |