Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 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 |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 * Library General Public License for more details. | 12 * Library General Public License for more details. |
| 13 * | 13 * |
| 14 * You should have received a copy of the GNU Library General Public License | 14 * You should have received a copy of the GNU Library General Public License |
| 15 * along with this library; see the file COPYING.LIB. If not, write to | 15 * along with this library; see the file COPYING.LIB. If not, write to |
| 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 17 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
| 18 */ | 18 */ |
| 19 | 19 |
| 20 #ifndef VariablesIterator_h | 20 #ifndef VariablesIterator_h |
| 21 #define VariablesIterator_h | 21 #define VariablesIterator_h |
| 22 | 22 |
| 23 #include "core/css/CSSVariablesIterator.h" | 23 #include "core/css/CSSVariablesIterator.h" |
| 24 #include "wtf/Vector.h" | 24 #include "wtf/Vector.h" |
| 25 #include "wtf/text/AtomicString.h" | 25 #include "wtf/text/AtomicString.h" |
| 26 | 26 |
| 27 namespace WebCore { | 27 namespace WebCore { |
| 28 | 28 |
| 29 class MutableStylePropertySet; | 29 class MutableStylePropertySet; |
| 30 class StylePropertySet; | |
| 30 | 31 |
| 31 class AbstractVariablesIterator : public CSSVariablesIterator { | 32 class AbstractVariablesIterator : public CSSVariablesIterator { |
| 32 public: | 33 public: |
| 33 virtual ~AbstractVariablesIterator() { } | 34 virtual ~AbstractVariablesIterator() { } |
| 34 | 35 |
| 35 protected: | 36 protected: |
| 36 void takeRemainingNames(Vector<AtomicString>& remainingNames) { m_remainingN ames.swap(remainingNames); } | 37 void takeRemainingNames(Vector<AtomicString>& remainingNames) { m_remainingN ames.swap(remainingNames); } |
| 37 | 38 |
| 39 static void initRemainingNames( | |
| 40 const StylePropertySet*, AbstractVariablesIterator*); | |
|
eseidel
2013/12/23 21:22:43
We don't wrap to 80c in blink (yet).
chrishtr
2013/12/23 22:06:46
Done.
| |
| 41 | |
| 38 private: | 42 private: |
| 39 virtual void advance() OVERRIDE; | 43 virtual void advance() OVERRIDE; |
| 40 virtual bool atEnd() const OVERRIDE { return m_remainingNames.isEmpty(); } | 44 virtual bool atEnd() const OVERRIDE { return m_remainingNames.isEmpty(); } |
| 41 virtual AtomicString name() const OVERRIDE { return m_remainingNames.last(); } | 45 virtual AtomicString name() const OVERRIDE { return m_remainingNames.last(); } |
| 42 virtual String value() const OVERRIDE; | 46 virtual String value() const OVERRIDE; |
| 43 virtual void addedVariable(const AtomicString& name) OVERRIDE; | 47 virtual void addedVariable(const AtomicString& name) OVERRIDE; |
| 44 virtual void removedVariable(const AtomicString& name) OVERRIDE; | 48 virtual void removedVariable(const AtomicString& name) OVERRIDE; |
| 45 virtual void clearedVariables() OVERRIDE; | 49 virtual void clearedVariables() OVERRIDE; |
| 46 | 50 |
| 47 virtual MutableStylePropertySet* propertySet() const = 0; | 51 virtual MutableStylePropertySet* propertySet() const = 0; |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 58 explicit VariablesIterator(MutableStylePropertySet* propertySet) : m_propert ySet(propertySet) { } | 62 explicit VariablesIterator(MutableStylePropertySet* propertySet) : m_propert ySet(propertySet) { } |
| 59 | 63 |
| 60 virtual MutableStylePropertySet* propertySet() const OVERRIDE { return m_pro pertySet.get(); } | 64 virtual MutableStylePropertySet* propertySet() const OVERRIDE { return m_pro pertySet.get(); } |
| 61 | 65 |
| 62 RefPtr<MutableStylePropertySet> m_propertySet; | 66 RefPtr<MutableStylePropertySet> m_propertySet; |
| 63 }; | 67 }; |
| 64 | 68 |
| 65 } // namespace WebCore | 69 } // namespace WebCore |
| 66 | 70 |
| 67 #endif // VariablesIterator_h | 71 #endif // VariablesIterator_h |
| OLD | NEW |