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

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

Issue 11052019: <browser> Make new implementation the default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove flag from chrome://flags, add platform app check for both implementation. Created 8 years, 2 months 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_impl.h" 5 #include "content/renderer/render_view_impl.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 2462 matching lines...) Expand 10 before | Expand all | Expand 10 after
2473 // WebKit::WebFrameClient ----------------------------------------------------- 2473 // WebKit::WebFrameClient -----------------------------------------------------
2474 2474
2475 WebPlugin* RenderViewImpl::createPlugin(WebFrame* frame, 2475 WebPlugin* RenderViewImpl::createPlugin(WebFrame* frame,
2476 const WebPluginParams& params) { 2476 const WebPluginParams& params) {
2477 WebPlugin* plugin = NULL; 2477 WebPlugin* plugin = NULL;
2478 if (content::GetContentClient()->renderer()->OverrideCreatePlugin( 2478 if (content::GetContentClient()->renderer()->OverrideCreatePlugin(
2479 this, frame, params, &plugin)) { 2479 this, frame, params, &plugin)) {
2480 return plugin; 2480 return plugin;
2481 } 2481 }
2482 2482
2483 // TODO(fsamuel): Remove this once upstreaming of the new browser plugin is 2483 const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
2484 // complete. 2484 if (UTF16ToASCII(params.mimeType) == content::kBrowserPluginMimeType) {
2485 if (UTF16ToASCII(params.mimeType) == content::kBrowserPluginNewMimeType) { 2485 if (cmd_line->HasSwitch(switches::kEnableBrowserPluginOldImplementation)) {
2486 return content::BrowserPluginManager::Get()-> 2486 // TODO(fsamuel): Remove this once upstreaming of the new browser plugin
2487 CreateBrowserPlugin(this, frame, params); 2487 // is complete.
2488 return content::old::BrowserPlugin::Create(this, frame, params);
2489 } else {
2490 return content::BrowserPluginManager::Get()->CreateBrowserPlugin(this,
2491 frame,
2492 params);
2493 }
2488 } 2494 }
2489 2495
2490 if (UTF16ToASCII(params.mimeType) == content::kBrowserPluginMimeType)
2491 return content::old::BrowserPlugin::Create(this, frame, params);
2492
2493 webkit::WebPluginInfo info; 2496 webkit::WebPluginInfo info;
2494 std::string mime_type; 2497 std::string mime_type;
2495 bool found = GetPluginInfo(params.url, frame->top()->document().url(), 2498 bool found = GetPluginInfo(params.url, frame->top()->document().url(),
2496 params.mimeType.utf8(), &info, &mime_type); 2499 params.mimeType.utf8(), &info, &mime_type);
2497 if (!found) 2500 if (!found)
2498 return NULL; 2501 return NULL;
2499 2502
2500 WebPluginParams params_to_use = params; 2503 WebPluginParams params_to_use = params;
2501 params_to_use.mimeType = WebString::fromUTF8(mime_type); 2504 params_to_use.mimeType = WebString::fromUTF8(mime_type);
2502 return CreatePlugin(frame, info, params_to_use); 2505 return CreatePlugin(frame, info, params_to_use);
(...skipping 3810 matching lines...) Expand 10 before | Expand all | Expand 10 after
6313 6316
6314 updating_frame_tree_ = true; 6317 updating_frame_tree_ = true;
6315 active_frame_id_map_.clear(); 6318 active_frame_id_map_.clear();
6316 6319
6317 target_process_id_ = process_id; 6320 target_process_id_ = process_id;
6318 target_routing_id_ = route_id; 6321 target_routing_id_ = route_id;
6319 CreateFrameTree(webview()->mainFrame(), frames); 6322 CreateFrameTree(webview()->mainFrame(), frames);
6320 6323
6321 updating_frame_tree_ = false; 6324 updating_frame_tree_ = false;
6322 } 6325 }
OLDNEW
« no previous file with comments | « content/renderer/browser_plugin/browser_plugin_browsertest.cc ('k') | content/test/data/browser_plugin_embedder.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698