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

Side by Side Diff: Source/core/html/HTMLObjectElement.cpp

Issue 23618022: BrowserPlugin/WebView - Move plugin lifetime to DOM (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Revised method for widget lifetime management. 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 /* 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, 2007, 2008, 2009, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 89
90 void HTMLObjectElement::parseAttribute(const QualifiedName& name, const AtomicSt ring& value) 90 void HTMLObjectElement::parseAttribute(const QualifiedName& name, const AtomicSt ring& value)
91 { 91 {
92 if (name == formAttr) 92 if (name == formAttr)
93 formAttributeChanged(); 93 formAttributeChanged();
94 else if (name == typeAttr) { 94 else if (name == typeAttr) {
95 m_serviceType = value.lower(); 95 m_serviceType = value.lower();
96 size_t pos = m_serviceType.find(";"); 96 size_t pos = m_serviceType.find(";");
97 if (pos != kNotFound) 97 if (pos != kNotFound)
98 m_serviceType = m_serviceType.left(pos); 98 m_serviceType = m_serviceType.left(pos);
99 if (renderer()) 99 // We'll always indicate we need an update, in case a plugin wants to
100 setNeedsWidgetUpdate(true); 100 // be created based on the service type.
101 setNeedsWidgetUpdate(true);
eseidel 2013/12/02 16:28:34 But we don't have the data yet, do we?
wjmaclean 2013/12/02 21:51:55 No, but we can check when we run the widget update
101 } else if (name == dataAttr) { 102 } else if (name == dataAttr) {
102 m_url = stripLeadingAndTrailingHTMLSpaces(value); 103 m_url = stripLeadingAndTrailingHTMLSpaces(value);
103 if (renderer()) { 104 if (renderer()) {
104 setNeedsWidgetUpdate(true); 105 setNeedsWidgetUpdate(true);
105 if (isImageType()) { 106 if (isImageType()) {
106 if (!m_imageLoader) 107 if (!m_imageLoader)
107 m_imageLoader = adoptPtr(new HTMLImageLoader(this)); 108 m_imageLoader = adoptPtr(new HTMLImageLoader(this));
108 m_imageLoader->updateFromElementIgnoringPreviousError(); 109 m_imageLoader->updateFromElementIgnoringPreviousError();
109 } 110 }
110 } 111 }
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 { 485 {
485 FormAssociatedElement::didMoveToNewDocument(oldDocument); 486 FormAssociatedElement::didMoveToNewDocument(oldDocument);
486 HTMLPlugInElement::didMoveToNewDocument(oldDocument); 487 HTMLPlugInElement::didMoveToNewDocument(oldDocument);
487 } 488 }
488 489
489 bool HTMLObjectElement::appendFormData(FormDataList& encoding, bool) 490 bool HTMLObjectElement::appendFormData(FormDataList& encoding, bool)
490 { 491 {
491 if (name().isEmpty()) 492 if (name().isEmpty())
492 return false; 493 return false;
493 494
494 Widget* widget = pluginWidget(); 495 Widget* widget = this->widget();
495 if (!widget || !widget->isPluginView()) 496 if (!widget || !widget->isPluginView())
496 return false; 497 return false;
497 String value; 498 String value;
498 if (!toPluginView(widget)->getFormValue(value)) 499 if (!toPluginView(widget)->getFormValue(value))
499 return false; 500 return false;
500 encoding.appendData(name(), value); 501 encoding.appendData(name(), value);
501 return true; 502 return true;
502 } 503 }
503 504
504 HTMLFormElement* HTMLObjectElement::virtualForm() const 505 HTMLFormElement* HTMLObjectElement::virtualForm() const
505 { 506 {
506 return FormAssociatedElement::form(); 507 return FormAssociatedElement::form();
507 } 508 }
508 509
509 bool HTMLObjectElement::isInteractiveContent() const 510 bool HTMLObjectElement::isInteractiveContent() const
510 { 511 {
511 return fastHasAttribute(usemapAttr); 512 return fastHasAttribute(usemapAttr);
512 } 513 }
513 514
514 } 515 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698