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

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

Issue 2135783003: Blink: Remove special HTMLPlugInElement logic for QuickTime. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
« no previous file with comments | « no previous file | 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 /** 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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 // Make sure any input event handlers introduced by the plugin are taken int o account. 510 // Make sure any input event handlers introduced by the plugin are taken int o account.
511 if (Page* page = document().frame()->page()) { 511 if (Page* page = document().frame()->page()) {
512 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordina tor()) 512 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordina tor())
513 scrollingCoordinator->notifyGeometryChanged(); 513 scrollingCoordinator->notifyGeometryChanged();
514 } 514 }
515 return true; 515 return true;
516 } 516 }
517 517
518 bool HTMLPlugInElement::shouldUsePlugin(const KURL& url, const String& mimeType, bool hasFallback, bool& useFallback) 518 bool HTMLPlugInElement::shouldUsePlugin(const KURL& url, const String& mimeType, bool hasFallback, bool& useFallback)
519 { 519 {
520 // Allow other plugins to win over QuickTime because if the user has
521 // installed a plugin that can handle TIFF (which QuickTime can also
522 // handle) they probably intended to override QT.
523 if (document().frame()->page() && (mimeType == "image/tiff" || mimeType == " image/tif" || mimeType == "image/x-tiff")) {
524 const PluginData* pluginData = document().frame()->pluginData();
525 String pluginName = pluginData ? pluginData->pluginNameForMimeType(mimeT ype) : String();
526 if (!pluginName.isEmpty() && !pluginName.contains("QuickTime", TextCaseI nsensitive)) {
527 useFallback = false;
528 return true;
529 }
530 }
531
532 ObjectContentType objectType = document().frame()->loader().client()->getObj ectContentType(url, mimeType, shouldPreferPlugInsForImages()); 520 ObjectContentType objectType = document().frame()->loader().client()->getObj ectContentType(url, mimeType, shouldPreferPlugInsForImages());
533 // If an object's content can't be handled and it has no fallback, let 521 // If an object's content can't be handled and it has no fallback, let
534 // it be handled as a plugin to show the broken plugin icon. 522 // it be handled as a plugin to show the broken plugin icon.
535 useFallback = objectType == ObjectContentNone && hasFallback; 523 useFallback = objectType == ObjectContentNone && hasFallback;
536 return objectType == ObjectContentNone || objectType == ObjectContentNetscap ePlugin; 524 return objectType == ObjectContentNone || objectType == ObjectContentNetscap ePlugin;
537
538 } 525 }
539 526
540 void HTMLPlugInElement::dispatchErrorEvent() 527 void HTMLPlugInElement::dispatchErrorEvent()
541 { 528 {
542 if (document().isPluginDocument() && document().localOwner()) 529 if (document().isPluginDocument() && document().localOwner())
543 document().localOwner()->dispatchEvent(Event::create(EventTypeNames::err or)); 530 document().localOwner()->dispatchEvent(Event::create(EventTypeNames::err or));
544 else 531 else
545 dispatchEvent(Event::create(EventTypeNames::error)); 532 dispatchEvent(Event::create(EventTypeNames::error));
546 } 533 }
547 534
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 590
604 void HTMLPlugInElement::lazyReattachIfNeeded() 591 void HTMLPlugInElement::lazyReattachIfNeeded()
605 { 592 {
606 if (!useFallbackContent() && needsWidgetUpdate() && layoutObject() && !isIma geType()) { 593 if (!useFallbackContent() && needsWidgetUpdate() && layoutObject() && !isIma geType()) {
607 lazyReattachIfAttached(); 594 lazyReattachIfAttached();
608 setPersistedPluginWidget(nullptr); 595 setPersistedPluginWidget(nullptr);
609 } 596 }
610 } 597 }
611 598
612 } // namespace blink 599 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698