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

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

Issue 1415573015: Count usage of <meter> with various -webkit-appearance values. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update histograms.xml Created 5 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) 2010 Nokia Corporation and/or its subsidiary(-ies). 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 PassRefPtrWillBeRawPtr<HTMLMeterElement> HTMLMeterElement::create(Document& docu ment) 51 PassRefPtrWillBeRawPtr<HTMLMeterElement> HTMLMeterElement::create(Document& docu ment)
52 { 52 {
53 RefPtrWillBeRawPtr<HTMLMeterElement> meter = adoptRefWillBeNoop(new HTMLMete rElement(document)); 53 RefPtrWillBeRawPtr<HTMLMeterElement> meter = adoptRefWillBeNoop(new HTMLMete rElement(document));
54 meter->ensureUserAgentShadowRoot(); 54 meter->ensureUserAgentShadowRoot();
55 return meter.release(); 55 return meter.release();
56 } 56 }
57 57
58 LayoutObject* HTMLMeterElement::createLayoutObject(const ComputedStyle& style) 58 LayoutObject* HTMLMeterElement::createLayoutObject(const ComputedStyle& style)
59 { 59 {
60 switch (style.appearance()) {
61 case ContinuousCapacityLevelIndicatorPart:
62 UseCounter::count(document(), UseCounter::MeterElementWithContinuousCapa cityAppearance);
63 break;
64 case DiscreteCapacityLevelIndicatorPart:
65 UseCounter::count(document(), UseCounter::MeterElementWithDiscreteCapaci tyAppearance);
66 break;
67 case MeterPart:
68 UseCounter::count(document(), UseCounter::MeterElementWithMeterAppearanc e);
69 break;
70 case NoControlPart:
71 UseCounter::count(document(), UseCounter::MeterElementWithNoneAppearance );
72 break;
73 case RatingLevelIndicatorPart:
74 UseCounter::count(document(), UseCounter::MeterElementWithRatingAppearan ce);
75 break;
76 case RelevancyLevelIndicatorPart:
77 UseCounter::count(document(), UseCounter::MeterElementWithRelevancyAppea rance);
78 break;
79 default:
80 break;
81 }
60 if (openShadowRoot() || !LayoutTheme::theme().supportsMeter(style.appearance ())) 82 if (openShadowRoot() || !LayoutTheme::theme().supportsMeter(style.appearance ()))
61 return LayoutObject::createObject(this, style); 83 return LayoutObject::createObject(this, style);
62 return new LayoutMeter(this); 84 return new LayoutMeter(this);
63 } 85 }
64 86
65 void HTMLMeterElement::parseAttribute(const QualifiedName& name, const AtomicStr ing& value) 87 void HTMLMeterElement::parseAttribute(const QualifiedName& name, const AtomicStr ing& value)
66 { 88 {
67 if (name == valueAttr || name == minAttr || name == maxAttr || name == lowAt tr || name == highAttr || name == optimumAttr) 89 if (name == valueAttr || name == minAttr || name == maxAttr || name == lowAt tr || name == highAttr || name == optimumAttr)
68 didElementStateChange(); 90 didElementStateChange();
69 else 91 else
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 lazyReattachIfAttached(); 239 lazyReattachIfAttached();
218 } 240 }
219 241
220 DEFINE_TRACE(HTMLMeterElement) 242 DEFINE_TRACE(HTMLMeterElement)
221 { 243 {
222 visitor->trace(m_value); 244 visitor->trace(m_value);
223 LabelableElement::trace(visitor); 245 LabelableElement::trace(visitor);
224 } 246 }
225 247
226 } // namespace 248 } // namespace
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698