| OLD | NEW |
| 1 /* | 1 /* |
| 2 * This file is part of the theme implementation for form controls in WebCore. | 2 * This file is part of the theme implementation for form controls in WebCore. |
| 3 * | 3 * |
| 4 * Copyright (C) 2005 Apple Computer, Inc. | 4 * Copyright (C) 2005 Apple Computer, Inc. |
| 5 * Copyright (C) 2008, 2009 Google, Inc. | 5 * Copyright (C) 2008, 2009 Google, 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 void setSearchCellState(const LayoutObject&, const IntRect&); | 124 void setSearchCellState(const LayoutObject&, const IntRect&); |
| 125 void setSearchFieldSize(ComputedStyle&) const; | 125 void setSearchFieldSize(ComputedStyle&) const; |
| 126 | 126 |
| 127 NSPopUpButtonCell* popupButton() const; | 127 NSPopUpButtonCell* popupButton() const; |
| 128 NSSearchFieldCell* search() const; | 128 NSSearchFieldCell* search() const; |
| 129 NSTextFieldCell* textField() const; | 129 NSTextFieldCell* textField() const; |
| 130 | 130 |
| 131 // A view associated to the contained document. Subclasses may not have such
a view and return a fake. | 131 // A view associated to the contained document. Subclasses may not have such
a view and return a fake. |
| 132 NSView* documentViewFor(const LayoutObject&) const; | 132 NSView* documentViewFor(const LayoutObject&) const; |
| 133 | 133 |
| 134 int minimumProgressBarHeight(const ComputedStyle&) const; | |
| 135 const IntSize* progressBarSizes() const; | |
| 136 const int* progressBarMargins(NSControlSize) const; | |
| 137 | |
| 138 void updateActiveState(NSCell*, const LayoutObject&); | 134 void updateActiveState(NSCell*, const LayoutObject&); |
| 139 | 135 |
| 140 // We estimate the animation rate of a Mac OS X progress bar is 33 fps. | 136 // We estimate the animation rate of a Mac OS X progress bar is 33 fps. |
| 141 // Hard code the value here because we haven't found API for it. | 137 // Hard code the value here because we haven't found API for it. |
| 142 static constexpr double progressAnimationFrameRate = 0.033; | 138 static constexpr double progressAnimationFrameRate = 0.033; |
| 143 // Mac OS X progress bar animation seems to have 256 frames. | 139 // Mac OS X progress bar animation seems to have 256 frames. |
| 144 static constexpr double progressAnimationNumFrames = 256; | 140 static constexpr double progressAnimationNumFrames = 256; |
| 145 | 141 |
| 146 static constexpr float baseFontSize = 11.0f; | 142 static constexpr float baseFontSize = 11.0f; |
| 147 static constexpr float menuListBaseArrowHeight = 4.0f; | 143 static constexpr float menuListBaseArrowHeight = 4.0f; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 158 | 154 |
| 159 protected: | 155 protected: |
| 160 void adjustMediaSliderThumbSize(ComputedStyle&) const; | 156 void adjustMediaSliderThumbSize(ComputedStyle&) const; |
| 161 String extraFullscreenStyleSheet() override; | 157 String extraFullscreenStyleSheet() override; |
| 162 | 158 |
| 163 // Controls color values returned from platformFocusRingColor(). systemColor
() will be used when false. | 159 // Controls color values returned from platformFocusRingColor(). systemColor
() will be used when false. |
| 164 bool usesTestModeFocusRingColor() const; | 160 bool usesTestModeFocusRingColor() const; |
| 165 | 161 |
| 166 bool shouldUseFallbackTheme(const ComputedStyle&) const override; | 162 bool shouldUseFallbackTheme(const ComputedStyle&) const override; |
| 167 | 163 |
| 164 void adjustProgressBarBounds(ComputedStyle&) const override; |
| 165 |
| 168 private: | 166 private: |
| 167 const int* progressBarHeights() const; |
| 168 const int* progressBarMargins(NSControlSize) const; |
| 169 String fileListNameForWidth(Locale&, const FileList*, const Font&, int width
) const override; | 169 String fileListNameForWidth(Locale&, const FileList*, const Font&, int width
) const override; |
| 170 String extraDefaultStyleSheet() override; | 170 String extraDefaultStyleSheet() override; |
| 171 bool themeDrawsFocusRing(const ComputedStyle&) const override; | 171 bool themeDrawsFocusRing(const ComputedStyle&) const override; |
| 172 | 172 |
| 173 ThemePainter& painter() override { return m_painter; } | 173 ThemePainter& painter() override { return m_painter; } |
| 174 | 174 |
| 175 mutable RetainPtr<NSPopUpButtonCell> m_popupButton; | 175 mutable RetainPtr<NSPopUpButtonCell> m_popupButton; |
| 176 mutable RetainPtr<NSSearchFieldCell> m_search; | 176 mutable RetainPtr<NSSearchFieldCell> m_search; |
| 177 mutable RetainPtr<NSMenu> m_searchMenuTemplate; | 177 mutable RetainPtr<NSMenu> m_searchMenuTemplate; |
| 178 mutable RetainPtr<NSLevelIndicatorCell> m_levelIndicator; | 178 mutable RetainPtr<NSLevelIndicatorCell> m_levelIndicator; |
| 179 mutable RetainPtr<NSTextFieldCell> m_textField; | 179 mutable RetainPtr<NSTextFieldCell> m_textField; |
| 180 | 180 |
| 181 mutable HashMap<int, RGBA32> m_systemColorCache; | 181 mutable HashMap<int, RGBA32> m_systemColorCache; |
| 182 | 182 |
| 183 RetainPtr<BlinkLayoutThemeNotificationObserver> m_notificationObserver; | 183 RetainPtr<BlinkLayoutThemeNotificationObserver> m_notificationObserver; |
| 184 | 184 |
| 185 ThemePainterMac m_painter; | 185 ThemePainterMac m_painter; |
| 186 }; | 186 }; |
| 187 | 187 |
| 188 } // namespace blink | 188 } // namespace blink |
| 189 | 189 |
| 190 #endif // LayoutThemeMac_h | 190 #endif // LayoutThemeMac_h |
| OLD | NEW |