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

Side by Side Diff: webkit/tools/test_shell/test_webview_delegate.cc

Issue 3530017: This changes GetPluginInfo so that we can request a list of plugins (Closed)
Patch Set: Fixing indents Created 10 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
« no previous file with comments | « webkit/support/webkit_support.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // This file contains the implementation of TestWebViewDelegate, which serves 5 // This file contains the implementation of TestWebViewDelegate, which serves
6 // as the WebViewDelegate for the TestShellWebHost. The host is expected to 6 // as the WebViewDelegate for the TestShellWebHost. The host is expected to
7 // have initialized a MessageLoop before these methods are called. 7 // have initialized a MessageLoop before these methods are called.
8 8
9 #include "webkit/tools/test_shell/test_webview_delegate.h" 9 #include "webkit/tools/test_shell/test_webview_delegate.h"
10 10
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 695
696 // WebFrameClient ------------------------------------------------------------ 696 // WebFrameClient ------------------------------------------------------------
697 697
698 WebPlugin* TestWebViewDelegate::createPlugin( 698 WebPlugin* TestWebViewDelegate::createPlugin(
699 WebFrame* frame, const WebPluginParams& params) { 699 WebFrame* frame, const WebPluginParams& params) {
700 bool allow_wildcard = true; 700 bool allow_wildcard = true;
701 WebPluginInfo info; 701 WebPluginInfo info;
702 std::string actual_mime_type; 702 std::string actual_mime_type;
703 if (!NPAPI::PluginList::Singleton()->GetPluginInfo( 703 if (!NPAPI::PluginList::Singleton()->GetPluginInfo(
704 params.url, params.mimeType.utf8(), allow_wildcard, &info, 704 params.url, params.mimeType.utf8(), allow_wildcard, &info,
705 &actual_mime_type) || !info.enabled) { 705 &actual_mime_type) || !info.enabled)
706 return NULL; 706 return NULL;
707 }
708
709 if (actual_mime_type.empty())
710 actual_mime_type = params.mimeType.utf8();
711 707
712 return new webkit_glue::WebPluginImpl( 708 return new webkit_glue::WebPluginImpl(
713 frame, params, info.path, actual_mime_type, AsWeakPtr()); 709 frame, params, info.path, actual_mime_type, AsWeakPtr());
714 } 710 }
715 711
716 WebWorker* TestWebViewDelegate::createWorker( 712 WebWorker* TestWebViewDelegate::createWorker(
717 WebFrame* frame, WebWorkerClient* client) { 713 WebFrame* frame, WebWorkerClient* client) {
718 return new TestWebWorker(); 714 return new TestWebWorker();
719 } 715 }
720 716
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
1347 } 1343 }
1348 1344
1349 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { 1345 void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) {
1350 fake_rect_ = rect; 1346 fake_rect_ = rect;
1351 using_fake_rect_ = true; 1347 using_fake_rect_ = true;
1352 } 1348 }
1353 1349
1354 WebRect TestWebViewDelegate::fake_window_rect() { 1350 WebRect TestWebViewDelegate::fake_window_rect() {
1355 return fake_rect_; 1351 return fake_rect_;
1356 } 1352 }
OLDNEW
« no previous file with comments | « webkit/support/webkit_support.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698