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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.h

Issue 2468833002: Count visible password fields on a page (Closed)
Patch Set: dcheng comments Created 4 years, 1 month 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) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 10 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
(...skipping 1292 matching lines...) Expand 10 before | Expand all | Expand 10 after
1303 1303
1304 void maybeRecordLoadReason(WouldLoadReason); 1304 void maybeRecordLoadReason(WouldLoadReason);
1305 WouldLoadReason wouldLoadReason() { return m_wouldLoadReason; } 1305 WouldLoadReason wouldLoadReason() { return m_wouldLoadReason; }
1306 1306
1307 PropertyRegistry* propertyRegistry(); 1307 PropertyRegistry* propertyRegistry();
1308 1308
1309 // Indicates whether the user has interacted with this particular Document. 1309 // Indicates whether the user has interacted with this particular Document.
1310 void setHasReceivedUserGesture() { m_hasReceivedUserGesture = true; } 1310 void setHasReceivedUserGesture() { m_hasReceivedUserGesture = true; }
1311 bool hasReceivedUserGesture() const { return m_hasReceivedUserGesture; } 1311 bool hasReceivedUserGesture() const { return m_hasReceivedUserGesture; }
1312 1312
1313 // Document maintains a counter of visible non-secure password
1314 // fields in the page. Used to notify the embedder when all visible
1315 // non-secure passwords fields are no longer visible.
1316 void incrementPasswordCount();
1317 void decrementPasswordCount();
1318 unsigned passwordCount() const;
1319
1313 protected: 1320 protected:
1314 Document(const DocumentInit&, DocumentClassFlags = DefaultDocumentClass); 1321 Document(const DocumentInit&, DocumentClassFlags = DefaultDocumentClass);
1315 1322
1316 void didUpdateSecurityOrigin() final; 1323 void didUpdateSecurityOrigin() final;
1317 1324
1318 void clearXMLVersion() { m_xmlVersion = String(); } 1325 void clearXMLVersion() { m_xmlVersion = String(); }
1319 1326
1320 virtual Document* cloneDocumentWithoutChildren(); 1327 virtual Document* cloneDocumentWithoutChildren();
1321 1328
1322 bool importContainerNodeChildren(ContainerNode* oldContainerNode, 1329 bool importContainerNodeChildren(ContainerNode* oldContainerNode,
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
1658 1665
1659 int m_nodeCount; 1666 int m_nodeCount;
1660 1667
1661 bool m_mayContainV0Shadow = false; 1668 bool m_mayContainV0Shadow = false;
1662 1669
1663 Member<SnapCoordinator> m_snapCoordinator; 1670 Member<SnapCoordinator> m_snapCoordinator;
1664 1671
1665 WouldLoadReason m_wouldLoadReason; 1672 WouldLoadReason m_wouldLoadReason;
1666 1673
1667 Member<PropertyRegistry> m_propertyRegistry; 1674 Member<PropertyRegistry> m_propertyRegistry;
1675
1676 unsigned m_passwordCount;
1668 }; 1677 };
1669 1678
1670 extern template class CORE_EXTERN_TEMPLATE_EXPORT Supplement<Document>; 1679 extern template class CORE_EXTERN_TEMPLATE_EXPORT Supplement<Document>;
1671 1680
1672 inline bool Document::shouldOverrideLegacyDescription( 1681 inline bool Document::shouldOverrideLegacyDescription(
1673 ViewportDescription::Type origin) const { 1682 ViewportDescription::Type origin) const {
1674 // The different (legacy) meta tags have different priorities based on the 1683 // The different (legacy) meta tags have different priorities based on the
1675 // type regardless of which order they appear in the DOM. The priority is 1684 // type regardless of which order they appear in the DOM. The priority is
1676 // given by the ViewportDescription::Type enum. 1685 // given by the ViewportDescription::Type enum.
1677 return origin >= m_legacyViewportDescription.type; 1686 return origin >= m_legacyViewportDescription.type;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1712 DEFINE_TYPE_CASTS(TreeScope, Document, document, true, true); 1721 DEFINE_TYPE_CASTS(TreeScope, Document, document, true, true);
1713 1722
1714 } // namespace blink 1723 } // namespace blink
1715 1724
1716 #ifndef NDEBUG 1725 #ifndef NDEBUG
1717 // Outside the WebCore namespace for ease of invocation from gdb. 1726 // Outside the WebCore namespace for ease of invocation from gdb.
1718 CORE_EXPORT void showLiveDocumentInstances(); 1727 CORE_EXPORT void showLiveDocumentInstances();
1719 #endif 1728 #endif
1720 1729
1721 #endif // Document_h 1730 #endif // Document_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698