| Index: third_party/WebKit/Source/core/layout/LayoutThemeMac.mm
|
| diff --git a/third_party/WebKit/Source/core/layout/LayoutThemeMac.mm b/third_party/WebKit/Source/core/layout/LayoutThemeMac.mm
|
| index a9fea2fdc7cc049f12c24736bc6597d0c252e6e3..18dd4a89429a096e77d995ee6f637d54a1946d76 100644
|
| --- a/third_party/WebKit/Source/core/layout/LayoutThemeMac.mm
|
| +++ b/third_party/WebKit/Source/core/layout/LayoutThemeMac.mm
|
| @@ -23,8 +23,6 @@
|
| #import "core/CSSValueKeywords.h"
|
| #import "core/HTMLNames.h"
|
| #import "core/fileapi/FileList.h"
|
| -#import "core/html/HTMLMeterElement.h"
|
| -#import "core/layout/LayoutMeter.h"
|
| #import "core/layout/LayoutProgress.h"
|
| #import "core/layout/LayoutView.h"
|
| #import "core/paint/MediaControlsPainter.h"
|
| @@ -659,91 +657,6 @@ const int* LayoutThemeMac::popupButtonPadding(NSControlSize size) const
|
| return padding[size];
|
| }
|
|
|
| -IntSize LayoutThemeMac::meterSizeForBounds(const LayoutMeter& layoutMeter, const IntRect& bounds) const
|
| -{
|
| - if (NoControlPart == layoutMeter.style()->appearance())
|
| - return bounds.size();
|
| -
|
| - NSLevelIndicatorCell* cell = levelIndicatorFor(layoutMeter);
|
| - // Makes enough room for cell's intrinsic size.
|
| - NSSize cellSize = [cell cellSizeForBounds:IntRect(IntPoint(), bounds.size())];
|
| - return IntSize(bounds.width() < cellSize.width ? cellSize.width : bounds.width(),
|
| - bounds.height() < cellSize.height ? cellSize.height : bounds.height());
|
| -}
|
| -
|
| -bool LayoutThemeMac::supportsMeter(ControlPart part) const
|
| -{
|
| - switch (part) {
|
| - case RelevancyLevelIndicatorPart:
|
| - case DiscreteCapacityLevelIndicatorPart:
|
| - case RatingLevelIndicatorPart:
|
| - case MeterPart:
|
| - case ContinuousCapacityLevelIndicatorPart:
|
| - return true;
|
| - default:
|
| - return false;
|
| - }
|
| -}
|
| -
|
| -NSLevelIndicatorStyle LayoutThemeMac::levelIndicatorStyleFor(ControlPart part) const
|
| -{
|
| - switch (part) {
|
| - case RelevancyLevelIndicatorPart:
|
| - return NSRelevancyLevelIndicatorStyle;
|
| - case DiscreteCapacityLevelIndicatorPart:
|
| - return NSDiscreteCapacityLevelIndicatorStyle;
|
| - case RatingLevelIndicatorPart:
|
| - return NSRatingLevelIndicatorStyle;
|
| - case MeterPart:
|
| - case ContinuousCapacityLevelIndicatorPart:
|
| - default:
|
| - return NSContinuousCapacityLevelIndicatorStyle;
|
| - }
|
| -}
|
| -
|
| -NSLevelIndicatorCell* LayoutThemeMac::levelIndicatorFor(const LayoutMeter& layoutMeter) const
|
| -{
|
| - const ComputedStyle& style = layoutMeter.styleRef();
|
| - ASSERT(style.appearance() != NoControlPart);
|
| -
|
| - if (!m_levelIndicator)
|
| - m_levelIndicator.adoptNS([[NSLevelIndicatorCell alloc] initWithLevelIndicatorStyle:NSContinuousCapacityLevelIndicatorStyle]);
|
| - NSLevelIndicatorCell* cell = m_levelIndicator.get();
|
| -
|
| - HTMLMeterElement* element = layoutMeter.meterElement();
|
| - double value = element->value();
|
| -
|
| - // Because NSLevelIndicatorCell does not support optimum-in-the-middle type
|
| - // coloring, we explicitly control the color instead giving low and high
|
| - // value to NSLevelIndicatorCell as is.
|
| - switch (element->gaugeRegion()) {
|
| - case HTMLMeterElement::GaugeRegionOptimum:
|
| - // Make meter the green.
|
| - [cell setWarningValue:value + 1];
|
| - [cell setCriticalValue:value + 2];
|
| - break;
|
| - case HTMLMeterElement::GaugeRegionSuboptimal:
|
| - // Make the meter yellow.
|
| - [cell setWarningValue:value - 1];
|
| - [cell setCriticalValue:value + 1];
|
| - break;
|
| - case HTMLMeterElement::GaugeRegionEvenLessGood:
|
| - // Make the meter red.
|
| - [cell setWarningValue:value - 2];
|
| - [cell setCriticalValue:value - 1];
|
| - break;
|
| - }
|
| -
|
| - [cell setLevelIndicatorStyle:levelIndicatorStyleFor(style.appearance())];
|
| - [cell setBaseWritingDirection:style.isLeftToRightDirection() ? NSWritingDirectionLeftToRight : NSWritingDirectionRightToLeft];
|
| - [cell setMinValue:element->min()];
|
| - [cell setMaxValue:element->max()];
|
| - RetainPtr<NSNumber> valueObject = [NSNumber numberWithDouble:value];
|
| - [cell setObjectValue:valueObject.get()];
|
| -
|
| - return cell;
|
| -}
|
| -
|
| const IntSize* LayoutThemeMac::progressBarSizes() const
|
| {
|
| static const IntSize sizes[3] = { IntSize(0, 20), IntSize(0, 12), IntSize(0, 12) };
|
|
|