Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 107183002: Move more of the plugin code in the renderer to use RenderFrame instead of RenderView. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 while ((observer = it.GetNext()) != NULL) { 460 while ((observer = it.GetNext()) != NULL) {
461 if (observer->OnMessageReceived(msg)) 461 if (observer->OnMessageReceived(msg))
462 return true; 462 return true;
463 } 463 }
464 464
465 // TODO(ajwong): Fill in with message handlers as various components 465 // TODO(ajwong): Fill in with message handlers as various components
466 // are migrated over to understand frames. 466 // are migrated over to understand frames.
467 return false; 467 return false;
468 } 468 }
469 469
470 int RenderFrameImpl::GetRoutingID() {
471 return routing_id_;
472 }
473
470 blink::WebPlugin* RenderFrameImpl::CreatePlugin( 474 blink::WebPlugin* RenderFrameImpl::CreatePlugin(
471 blink::WebFrame* frame, 475 blink::WebFrame* frame,
472 const WebPluginInfo& info, 476 const WebPluginInfo& info,
473 const blink::WebPluginParams& params) { 477 const blink::WebPluginParams& params) {
474 #if defined(ENABLE_PLUGINS) 478 #if defined(ENABLE_PLUGINS)
475 bool pepper_plugin_was_registered = false; 479 bool pepper_plugin_was_registered = false;
476 scoped_refptr<PluginModule> pepper_module(PluginModule::Create( 480 scoped_refptr<PluginModule> pepper_module(PluginModule::Create(
477 this, info, &pepper_plugin_was_registered)); 481 this, info, &pepper_plugin_was_registered));
478 if (pepper_plugin_was_registered) { 482 if (pepper_plugin_was_registered) {
479 if (pepper_module.get()) { 483 if (pepper_module.get()) {
(...skipping 23 matching lines...) Expand all
503 } 507 }
504 508
505 if (UTF16ToASCII(params.mimeType) == kBrowserPluginMimeType) { 509 if (UTF16ToASCII(params.mimeType) == kBrowserPluginMimeType) {
506 return render_view_->GetBrowserPluginManager()->CreateBrowserPlugin( 510 return render_view_->GetBrowserPluginManager()->CreateBrowserPlugin(
507 render_view_, frame, params); 511 render_view_, frame, params);
508 } 512 }
509 513
510 #if defined(ENABLE_PLUGINS) 514 #if defined(ENABLE_PLUGINS)
511 WebPluginInfo info; 515 WebPluginInfo info;
512 std::string mime_type; 516 std::string mime_type;
513 bool found = render_view_->GetPluginInfo( 517 bool found = false;
514 params.url, frame->top()->document().url(), params.mimeType.utf8(), 518 Send(new FrameHostMsg_GetPluginInfo(
515 &info, &mime_type); 519 routing_id_, params.url, frame->top()->document().url(),
520 params.mimeType.utf8(), &found, &info, &mime_type));
516 if (!found) 521 if (!found)
517 return NULL; 522 return NULL;
518 523
519 WebPluginParams params_to_use = params; 524 WebPluginParams params_to_use = params;
520 params_to_use.mimeType = WebString::fromUTF8(mime_type); 525 params_to_use.mimeType = WebString::fromUTF8(mime_type);
521 return CreatePlugin(frame, info, params_to_use); 526 return CreatePlugin(frame, info, params_to_use);
522 #else 527 #else
523 return NULL; 528 return NULL;
524 #endif // defined(ENABLE_PLUGINS) 529 #endif // defined(ENABLE_PLUGINS)
525 } 530 }
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 // 1024 //
1020 // TODO(davidben): Avoid this awkward duplication of state. See comment on 1025 // TODO(davidben): Avoid this awkward duplication of state. See comment on
1021 // NavigationState::should_replace_current_entry(). 1026 // NavigationState::should_replace_current_entry().
1022 should_replace_current_entry = 1027 should_replace_current_entry =
1023 navigation_state->should_replace_current_entry(); 1028 navigation_state->should_replace_current_entry();
1024 } 1029 }
1025 request.setExtraData( 1030 request.setExtraData(
1026 new RequestExtraData(referrer_policy, 1031 new RequestExtraData(referrer_policy,
1027 custom_user_agent, 1032 custom_user_agent,
1028 was_after_preconnect_request, 1033 was_after_preconnect_request,
1034 routing_id_,
1029 (frame == top_frame), 1035 (frame == top_frame),
1030 frame->identifier(), 1036 frame->identifier(),
1031 GURL(frame->document().securityOrigin().toString()), 1037 GURL(frame->document().securityOrigin().toString()),
1032 frame->parent() == top_frame, 1038 frame->parent() == top_frame,
1033 frame->parent() ? frame->parent()->identifier() : -1, 1039 frame->parent() ? frame->parent()->identifier() : -1,
1034 navigation_state->allow_download(), 1040 navigation_state->allow_download(),
1035 transition_type, 1041 transition_type,
1036 should_replace_current_entry, 1042 should_replace_current_entry,
1037 navigation_state->transferred_request_child_id(), 1043 navigation_state->transferred_request_child_id(),
1038 navigation_state->transferred_request_request_id())); 1044 navigation_state->transferred_request_request_id()));
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
1336 void RenderFrameImpl::AddObserver(RenderFrameObserver* observer) { 1342 void RenderFrameImpl::AddObserver(RenderFrameObserver* observer) {
1337 observers_.AddObserver(observer); 1343 observers_.AddObserver(observer);
1338 } 1344 }
1339 1345
1340 void RenderFrameImpl::RemoveObserver(RenderFrameObserver* observer) { 1346 void RenderFrameImpl::RemoveObserver(RenderFrameObserver* observer) {
1341 observer->RenderFrameGone(); 1347 observer->RenderFrameGone();
1342 observers_.RemoveObserver(observer); 1348 observers_.RemoveObserver(observer);
1343 } 1349 }
1344 1350
1345 } // namespace content 1351 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698