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 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 bool found; | 556 bool found; |
557 std::string mime_type; | 557 std::string mime_type; |
558 Send(new ViewHostMsg_GetPluginInfo( | 558 Send(new ViewHostMsg_GetPluginInfo( |
559 routing_id_, params.url, frame->top()->document().url(), | 559 routing_id_, params.url, frame->top()->document().url(), |
560 params.mimeType.utf8(), &found, &info, &mime_type)); | 560 params.mimeType.utf8(), &found, &info, &mime_type)); |
561 if (!found || !webkit::IsPluginEnabled(info)) | 561 if (!found || !webkit::IsPluginEnabled(info)) |
562 return NULL; | 562 return NULL; |
563 | 563 |
564 bool pepper_plugin_was_registered = false; | 564 bool pepper_plugin_was_registered = false; |
565 scoped_refptr<webkit::ppapi::PluginModule> pepper_module( | 565 scoped_refptr<webkit::ppapi::PluginModule> pepper_module( |
566 pepper_delegate_.CreatePepperPlugin(info.path, | 566 pepper_delegate_.CreatePepperPluginModule(info, |
567 &pepper_plugin_was_registered)); | 567 &pepper_plugin_was_registered)); |
568 if (pepper_plugin_was_registered) { | 568 if (pepper_plugin_was_registered) { |
569 if (pepper_module) | 569 if (pepper_module) |
570 return CreatePepperPlugin(frame, params, info.path, pepper_module.get()); | 570 return CreatePepperPlugin(frame, params, info.path, pepper_module.get()); |
571 return NULL; | 571 return NULL; |
572 } | 572 } |
573 return CreateNPAPIPlugin(frame, params, info.path, mime_type); | 573 return CreateNPAPIPlugin(frame, params, info.path, mime_type); |
574 } | 574 } |
575 | 575 |
576 void RenderView::RegisterPluginDelegate(WebPluginDelegateProxy* delegate) { | 576 void RenderView::RegisterPluginDelegate(WebPluginDelegateProxy* delegate) { |
577 plugin_delegates_.insert(delegate); | 577 plugin_delegates_.insert(delegate); |
(...skipping 3969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4547 } | 4547 } |
4548 #endif | 4548 #endif |
4549 | 4549 |
4550 void RenderView::OnContextMenuClosed( | 4550 void RenderView::OnContextMenuClosed( |
4551 const webkit_glue::CustomContextMenuContext& custom_context) { | 4551 const webkit_glue::CustomContextMenuContext& custom_context) { |
4552 if (custom_context.is_pepper_menu) | 4552 if (custom_context.is_pepper_menu) |
4553 pepper_delegate_.OnContextMenuClosed(custom_context); | 4553 pepper_delegate_.OnContextMenuClosed(custom_context); |
4554 else | 4554 else |
4555 context_menu_node_.reset(); | 4555 context_menu_node_.reset(); |
4556 } | 4556 } |
OLD | NEW |