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 "content/renderer/render_view.h" | 5 #include "content/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 20 matching lines...) Expand all Loading... | |
| 31 #include "chrome/common/extensions/extension_constants.h" | 31 #include "chrome/common/extensions/extension_constants.h" |
| 32 #include "chrome/common/extensions/extension_set.h" | 32 #include "chrome/common/extensions/extension_set.h" |
| 33 #include "chrome/common/json_value_serializer.h" | 33 #include "chrome/common/json_value_serializer.h" |
| 34 #include "chrome/common/pepper_plugin_registry.h" | 34 #include "chrome/common/pepper_plugin_registry.h" |
| 35 #include "chrome/common/render_messages.h" | 35 #include "chrome/common/render_messages.h" |
| 36 #include "chrome/common/render_messages_params.h" | 36 #include "chrome/common/render_messages_params.h" |
| 37 #include "chrome/common/render_view_commands.h" | 37 #include "chrome/common/render_view_commands.h" |
| 38 #include "chrome/common/thumbnail_score.h" | 38 #include "chrome/common/thumbnail_score.h" |
| 39 #include "chrome/common/url_constants.h" | 39 #include "chrome/common/url_constants.h" |
| 40 #include "chrome/common/web_apps.h" | 40 #include "chrome/common/web_apps.h" |
| 41 #include "chrome/common/window_container_type.h" | |
| 42 #include "chrome/renderer/about_handler.h" | 41 #include "chrome/renderer/about_handler.h" |
| 43 #include "chrome/renderer/autofill/autofill_agent.h" | 42 #include "chrome/renderer/autofill/autofill_agent.h" |
| 44 #include "chrome/renderer/autofill/form_manager.h" | 43 #include "chrome/renderer/autofill/form_manager.h" |
| 45 #include "chrome/renderer/autofill/password_autofill_manager.h" | 44 #include "chrome/renderer/autofill/password_autofill_manager.h" |
| 46 #include "chrome/renderer/automation/dom_automation_controller.h" | 45 #include "chrome/renderer/automation/dom_automation_controller.h" |
| 47 #include "chrome/renderer/devtools_agent.h" | 46 #include "chrome/renderer/devtools_agent.h" |
| 48 #include "chrome/renderer/devtools_client.h" | 47 #include "chrome/renderer/devtools_client.h" |
| 49 #include "chrome/renderer/extension_groups.h" | 48 #include "chrome/renderer/extension_groups.h" |
| 50 #include "chrome/renderer/extensions/bindings_utils.h" | 49 #include "chrome/renderer/extensions/bindings_utils.h" |
| 51 #include "chrome/renderer/extensions/event_bindings.h" | 50 #include "chrome/renderer/extensions/event_bindings.h" |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 69 #include "chrome/renderer/user_script_slave.h" | 68 #include "chrome/renderer/user_script_slave.h" |
| 70 #include "chrome/renderer/visitedlink_slave.h" | 69 #include "chrome/renderer/visitedlink_slave.h" |
| 71 #include "content/common/appcache/appcache_dispatcher.h" | 70 #include "content/common/appcache/appcache_dispatcher.h" |
| 72 #include "content/common/clipboard_messages.h" | 71 #include "content/common/clipboard_messages.h" |
| 73 #include "content/common/content_constants.h" | 72 #include "content/common/content_constants.h" |
| 74 #include "content/common/database_messages.h" | 73 #include "content/common/database_messages.h" |
| 75 #include "content/common/drag_messages.h" | 74 #include "content/common/drag_messages.h" |
| 76 #include "content/common/file_system/file_system_dispatcher.h" | 75 #include "content/common/file_system/file_system_dispatcher.h" |
| 77 #include "content/common/file_system/webfilesystem_callback_dispatcher.h" | 76 #include "content/common/file_system/webfilesystem_callback_dispatcher.h" |
| 78 #include "content/common/notification_service.h" | 77 #include "content/common/notification_service.h" |
| 79 #include "content/common/page_zoom.h" | |
| 80 #include "content/common/pepper_messages.h" | 78 #include "content/common/pepper_messages.h" |
| 81 #include "content/common/renderer_preferences.h" | 79 #include "content/common/renderer_preferences.h" |
| 82 #include "content/common/view_messages.h" | 80 #include "content/common/view_messages.h" |
| 83 #include "content/renderer/audio_message_filter.h" | 81 #include "content/renderer/audio_message_filter.h" |
| 84 #include "content/renderer/content_renderer_client.h" | 82 #include "content/renderer/content_renderer_client.h" |
| 85 #include "content/renderer/device_orientation_dispatcher.h" | 83 #include "content/renderer/device_orientation_dispatcher.h" |
| 86 #include "content/renderer/external_popup_menu.h" | 84 #include "content/renderer/external_popup_menu.h" |
| 87 #include "content/renderer/geolocation_dispatcher.h" | 85 #include "content/renderer/geolocation_dispatcher.h" |
| 88 #include "content/renderer/ggl.h" | 86 #include "content/renderer/ggl.h" |
| 89 #include "content/renderer/load_progress_tracker.h" | 87 #include "content/renderer/load_progress_tracker.h" |
| (...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 908 } | 906 } |
| 909 | 907 |
| 910 void RenderView::PluginCrashed(const FilePath& plugin_path) { | 908 void RenderView::PluginCrashed(const FilePath& plugin_path) { |
| 911 Send(new ViewHostMsg_CrashedPlugin(routing_id_, plugin_path)); | 909 Send(new ViewHostMsg_CrashedPlugin(routing_id_, plugin_path)); |
| 912 } | 910 } |
| 913 | 911 |
| 914 WebPlugin* RenderView::CreatePluginNoCheck(WebFrame* frame, | 912 WebPlugin* RenderView::CreatePluginNoCheck(WebFrame* frame, |
| 915 const WebPluginParams& params) { | 913 const WebPluginParams& params) { |
| 916 webkit::npapi::WebPluginInfo info; | 914 webkit::npapi::WebPluginInfo info; |
| 917 bool found; | 915 bool found; |
| 918 ContentSetting setting; | 916 int content_setting; |
| 919 std::string mime_type; | 917 std::string mime_type; |
| 920 Send(new ViewHostMsg_GetPluginInfo( | 918 Send(new ViewHostMsg_GetPluginInfo( |
| 921 routing_id_, params.url, frame->top()->url(), params.mimeType.utf8(), | 919 routing_id_, params.url, frame->top()->url(), params.mimeType.utf8(), |
|
Tom Sepez
2011/03/23 17:32:53
Constructor now expecting an int* not a ContentSet
| |
| 922 &found, &info, &setting, &mime_type)); | 920 &found, &info, &content_setting, &mime_type)); |
| 923 if (!found || !webkit::npapi::IsPluginEnabled(info)) | 921 if (!found || !webkit::npapi::IsPluginEnabled(info)) |
| 924 return NULL; | 922 return NULL; |
| 925 | 923 |
| 926 scoped_refptr<webkit::ppapi::PluginModule> pepper_module( | 924 scoped_refptr<webkit::ppapi::PluginModule> pepper_module( |
| 927 pepper_delegate_.CreatePepperPlugin(info.path)); | 925 pepper_delegate_.CreatePepperPlugin(info.path)); |
| 928 if (pepper_module) | 926 if (pepper_module) |
| 929 return CreatePepperPlugin(frame, params, info.path, pepper_module.get()); | 927 return CreatePepperPlugin(frame, params, info.path, pepper_module.get()); |
| 930 return CreateNPAPIPlugin(frame, params, info.path, mime_type); | 928 return CreateNPAPIPlugin(frame, params, info.path, mime_type); |
| 931 } | 929 } |
| 932 | 930 |
| (...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2292 } | 2290 } |
| 2293 | 2291 |
| 2294 bool RenderView::runFileChooser( | 2292 bool RenderView::runFileChooser( |
| 2295 const WebKit::WebFileChooserParams& params, | 2293 const WebKit::WebFileChooserParams& params, |
| 2296 WebFileChooserCompletion* chooser_completion) { | 2294 WebFileChooserCompletion* chooser_completion) { |
| 2297 // Do not open the file dialog in a hidden RenderView. | 2295 // Do not open the file dialog in a hidden RenderView. |
| 2298 if (is_hidden()) | 2296 if (is_hidden()) |
| 2299 return false; | 2297 return false; |
| 2300 ViewHostMsg_RunFileChooser_Params ipc_params; | 2298 ViewHostMsg_RunFileChooser_Params ipc_params; |
| 2301 if (params.directory) | 2299 if (params.directory) |
| 2302 ipc_params.mode = ViewHostMsg_RunFileChooser_Params::OpenFolder; | 2300 ipc_params.mode = ViewHostMsg_RunFileChooser_Mode::OpenFolder; |
| 2303 else if (params.multiSelect) | 2301 else if (params.multiSelect) |
| 2304 ipc_params.mode = ViewHostMsg_RunFileChooser_Params::OpenMultiple; | 2302 ipc_params.mode = ViewHostMsg_RunFileChooser_Mode::OpenMultiple; |
| 2305 else | 2303 else |
| 2306 ipc_params.mode = ViewHostMsg_RunFileChooser_Params::Open; | 2304 ipc_params.mode = ViewHostMsg_RunFileChooser_Mode::Open; |
| 2307 ipc_params.title = params.title; | 2305 ipc_params.title = params.title; |
| 2308 ipc_params.default_file_name = | 2306 ipc_params.default_file_name = |
| 2309 webkit_glue::WebStringToFilePath(params.initialValue); | 2307 webkit_glue::WebStringToFilePath(params.initialValue); |
| 2310 ipc_params.accept_types = params.acceptTypes; | 2308 ipc_params.accept_types = params.acceptTypes; |
| 2311 | 2309 |
| 2312 return ScheduleFileChooser(ipc_params, chooser_completion); | 2310 return ScheduleFileChooser(ipc_params, chooser_completion); |
| 2313 } | 2311 } |
| 2314 | 2312 |
| 2315 void RenderView::runModalAlertDialog( | 2313 void RenderView::runModalAlertDialog( |
| 2316 WebFrame* frame, const WebString& message) { | 2314 WebFrame* frame, const WebString& message) { |
| (...skipping 3075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5392 const webkit_glue::CustomContextMenuContext& custom_context) { | 5390 const webkit_glue::CustomContextMenuContext& custom_context) { |
| 5393 if (custom_context.is_pepper_menu) | 5391 if (custom_context.is_pepper_menu) |
| 5394 pepper_delegate_.OnContextMenuClosed(custom_context); | 5392 pepper_delegate_.OnContextMenuClosed(custom_context); |
| 5395 else | 5393 else |
| 5396 context_menu_node_.reset(); | 5394 context_menu_node_.reset(); |
| 5397 } | 5395 } |
| 5398 | 5396 |
| 5399 void RenderView::OnNetworkStateChanged(bool online) { | 5397 void RenderView::OnNetworkStateChanged(bool online) { |
| 5400 WebNetworkStateNotifier::setOnLine(online); | 5398 WebNetworkStateNotifier::setOnLine(online); |
| 5401 } | 5399 } |
| OLD | NEW |