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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp

Issue 2121433002: Fix navigator.plugins and navigator.mimeTypes for OOPIFs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 5 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
OLDNEW
1 /** 1 /**
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de)
5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. 5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 } 509 }
510 return true; 510 return true;
511 } 511 }
512 512
513 bool HTMLPlugInElement::shouldUsePlugin(const KURL& url, const String& mimeType, bool hasFallback, bool& useFallback) 513 bool HTMLPlugInElement::shouldUsePlugin(const KURL& url, const String& mimeType, bool hasFallback, bool& useFallback)
514 { 514 {
515 // Allow other plugins to win over QuickTime because if the user has 515 // Allow other plugins to win over QuickTime because if the user has
516 // installed a plugin that can handle TIFF (which QuickTime can also 516 // installed a plugin that can handle TIFF (which QuickTime can also
517 // handle) they probably intended to override QT. 517 // handle) they probably intended to override QT.
518 if (document().frame()->page() && (mimeType == "image/tiff" || mimeType == " image/tif" || mimeType == "image/x-tiff")) { 518 if (document().frame()->page() && (mimeType == "image/tiff" || mimeType == " image/tif" || mimeType == "image/x-tiff")) {
519 const PluginData* pluginData = document().frame()->page()->pluginData(); 519 const PluginData* pluginData = document().frame()->pluginData();
520 String pluginName = pluginData ? pluginData->pluginNameForMimeType(mimeT ype) : String(); 520 String pluginName = pluginData ? pluginData->pluginNameForMimeType(mimeT ype) : String();
521 if (!pluginName.isEmpty() && !pluginName.contains("QuickTime", TextCaseI nsensitive)) { 521 if (!pluginName.isEmpty() && !pluginName.contains("QuickTime", TextCaseI nsensitive)) {
522 useFallback = false; 522 useFallback = false;
523 return true; 523 return true;
524 } 524 }
525 } 525 }
526 526
527 ObjectContentType objectType = document().frame()->loader().client()->getObj ectContentType(url, mimeType, shouldPreferPlugInsForImages()); 527 ObjectContentType objectType = document().frame()->loader().client()->getObj ectContentType(url, mimeType, shouldPreferPlugInsForImages());
528 // If an object's content can't be handled and it has no fallback, let 528 // If an object's content can't be handled and it has no fallback, let
529 // it be handled as a plugin to show the broken plugin icon. 529 // it be handled as a plugin to show the broken plugin icon.
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 598
599 void HTMLPlugInElement::lazyReattachIfNeeded() 599 void HTMLPlugInElement::lazyReattachIfNeeded()
600 { 600 {
601 if (!useFallbackContent() && needsWidgetUpdate() && layoutObject() && !isIma geType()) { 601 if (!useFallbackContent() && needsWidgetUpdate() && layoutObject() && !isIma geType()) {
602 lazyReattachIfAttached(); 602 lazyReattachIfAttached();
603 setPersistedPluginWidget(nullptr); 603 setPersistedPluginWidget(nullptr);
604 } 604 }
605 } 605 }
606 606
607 } // namespace blink 607 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalFrame.cpp ('k') | third_party/WebKit/Source/core/loader/DocumentLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698