Commit 99fbb7c8 authored by rob.buis@samsung.com's avatar rob.buis@samsung.com

Make better use of MediaTypeNames

These places may as well just use the global strings
from MediaTypeNames.

This CL also removes the unused speechButton method.

Review URL: https://codereview.chromium.org/564133003

git-svn-id: svn://svn.chromium.org/blink/trunk@182012 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 857e7d2b
......@@ -28,6 +28,7 @@
#include "core/css/parser/BisonCSSParser.h"
#include "core/CSSValueKeywords.h"
#include "core/MediaTypeNames.h"
#include "core/StylePropertyShorthand.h"
#include "core/css/CSSAspectRatioValue.h"
#include "core/css/CSSBasicShapes.h"
......@@ -1522,12 +1523,12 @@ MediaQuery* BisonCSSParser::createFloatingMediaQuery(MediaQuery::Restrictor rest
MediaQuery* BisonCSSParser::createFloatingMediaQuery(PassOwnPtrWillBeRawPtr<WillBeHeapVector<OwnPtrWillBeMember<MediaQueryExp> > > expressions)
{
return createFloatingMediaQuery(MediaQuery::None, AtomicString("all", AtomicString::ConstructFromLiteral), expressions);
return createFloatingMediaQuery(MediaQuery::None, MediaTypeNames::all, expressions);
}
MediaQuery* BisonCSSParser::createFloatingNotAllQuery()
{
return createFloatingMediaQuery(MediaQuery::Not, AtomicString("all", AtomicString::ConstructFromLiteral), sinkFloatingMediaQueryExpList(createFloatingMediaQueryExpList()));
return createFloatingMediaQuery(MediaQuery::Not, MediaTypeNames::all, sinkFloatingMediaQueryExpList(createFloatingMediaQueryExpList()));
}
PassOwnPtrWillBeRawPtr<MediaQuery> BisonCSSParser::sinkFloatingMediaQuery(MediaQuery* query)
......
......@@ -28,6 +28,7 @@
#include "core/frame/FrameView.h"
#include "core/HTMLNames.h"
#include "core/MediaTypeNames.h"
#include "core/accessibility/AXObjectCache.h"
#include "core/css/FontFaceSet.h"
#include "core/css/resolver/StyleResolver.h"
......@@ -105,7 +106,7 @@ FrameView::FrameView(LocalFrame* frame)
, m_updateWidgetsTimer(this, &FrameView::updateWidgetsTimerFired)
, m_isTransparent(false)
, m_baseBackgroundColor(Color::white)
, m_mediaType("screen")
, m_mediaType(MediaTypeNames::screen)
, m_overflowStatusDirty(true)
, m_viewportRenderer(0)
, m_wasScrolledByUser(false)
......@@ -1092,7 +1093,7 @@ void FrameView::adjustMediaTypeForPrinting(bool printing)
if (printing) {
if (m_mediaTypeWhenNotPrinting.isNull())
m_mediaTypeWhenNotPrinting = mediaType();
setMediaType("print");
setMediaType(MediaTypeNames::print);
} else {
if (!m_mediaTypeWhenNotPrinting.isNull())
setMediaType(m_mediaTypeWhenNotPrinting);
......
......@@ -107,12 +107,6 @@ const AtomicString& sliderTrack()
return name;
}
const AtomicString& speechButton()
{
DEFINE_STATIC_LOCAL(AtomicString, name, ("speech", AtomicString::ConstructFromLiteral));
return name;
}
const AtomicString& textFieldContainer()
{
DEFINE_STATIC_LOCAL(AtomicString, name, ("text-field-container", AtomicString::ConstructFromLiteral));
......
......@@ -49,7 +49,6 @@ const AtomicString& placeholder();
const AtomicString& searchDecoration();
const AtomicString& sliderThumb();
const AtomicString& sliderTrack();
const AtomicString& speechButton();
const AtomicString& textFieldContainer();
const AtomicString& optGroupLabel();
......
......@@ -23,6 +23,7 @@
#include "config.h"
#include "core/svg/SVGStyleElement.h"
#include "core/MediaTypeNames.h"
#include "core/css/CSSStyleSheet.h"
#include "wtf/StdLibExtras.h"
......@@ -75,9 +76,8 @@ void SVGStyleElement::setType(const AtomicString& type)
const AtomicString& SVGStyleElement::media() const
{
DEFINE_STATIC_LOCAL(const AtomicString, defaultValue, ("all", AtomicString::ConstructFromLiteral));
const AtomicString& n = fastGetAttribute(SVGNames::mediaAttr);
return n.isNull() ? defaultValue : n;
return n.isNull() ? MediaTypeNames::all : n;
}
void SVGStyleElement::setMedia(const AtomicString& media)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment