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

Side by Side Diff: Source/core/html/HTMLMetaElement-in.cpp

Issue 329943004: Implementation of brand-color (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add RuntimeEnabledFeatures Created 6 years, 6 months 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2010 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2010 Apple Inc. All rights reserved.
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.
11 * 11 *
12 * This library is distributed in the hope that it will be useful, 12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details. 15 * Library General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Library General Public License 17 * You should have received a copy of the GNU Library General Public License
18 * along with this library; see the file COPYING.LIB. If not, write to 18 * along with this library; see the file COPYING.LIB. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA. 20 * Boston, MA 02110-1301, USA.
21 */ 21 */
22 22
23 #include "config.h" 23 #include "config.h"
24 #include "core/html/HTMLMetaElement.h" 24 #include "core/html/HTMLMetaElement.h"
25 25
26 #include "HTMLNames.h" 26 #include "HTMLNames.h"
27 #include "RuntimeEnabledFeatures.h"
27 #include "core/dom/Document.h" 28 #include "core/dom/Document.h"
29 #include "core/frame/LocalFrame.h"
28 #include "core/frame/Settings.h" 30 #include "core/frame/Settings.h"
31 #include "core/loader/FrameLoaderClient.h"
29 32
30 namespace WebCore { 33 namespace WebCore {
31 34
32 #define DEFINE_ARRAY_FOR_MATCHING(name, source, maxMatchLength) \ 35 #define DEFINE_ARRAY_FOR_MATCHING(name, source, maxMatchLength) \
33 const UChar* name; \ 36 const UChar* name; \
34 const unsigned uMaxMatchLength = maxMatchLength; \ 37 const unsigned uMaxMatchLength = maxMatchLength; \
35 UChar characterBuffer[uMaxMatchLength]; \ 38 UChar characterBuffer[uMaxMatchLength]; \
36 if (!source.is8Bit()) { \ 39 if (!source.is8Bit()) { \
37 name = source.characters16(); \ 40 name = source.characters16(); \
38 } else { \ 41 } else { \
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 const AtomicString& nameValue = fastGetAttribute(nameAttr); 467 const AtomicString& nameValue = fastGetAttribute(nameAttr);
465 if (!nameValue.isEmpty()) { 468 if (!nameValue.isEmpty()) {
466 if (equalIgnoringCase(nameValue, "viewport")) 469 if (equalIgnoringCase(nameValue, "viewport"))
467 processViewportContentAttribute(contentValue, ViewportDescription::V iewportMeta); 470 processViewportContentAttribute(contentValue, ViewportDescription::V iewportMeta);
468 else if (equalIgnoringCase(nameValue, "referrer")) 471 else if (equalIgnoringCase(nameValue, "referrer"))
469 document().processReferrerPolicy(contentValue); 472 document().processReferrerPolicy(contentValue);
470 else if (equalIgnoringCase(nameValue, "handheldfriendly") && equalIgnori ngCase(contentValue, "true")) 473 else if (equalIgnoringCase(nameValue, "handheldfriendly") && equalIgnori ngCase(contentValue, "true"))
471 processViewportContentAttribute("width=device-width", ViewportDescri ption::HandheldFriendlyMeta); 474 processViewportContentAttribute("width=device-width", ViewportDescri ption::HandheldFriendlyMeta);
472 else if (equalIgnoringCase(nameValue, "mobileoptimized")) 475 else if (equalIgnoringCase(nameValue, "mobileoptimized"))
473 processViewportContentAttribute("width=device-width, initial-scale=1 ", ViewportDescription::MobileOptimizedMeta); 476 processViewportContentAttribute("width=device-width, initial-scale=1 ", ViewportDescription::MobileOptimizedMeta);
477 else if (RuntimeEnabledFeatures::brandColorEnabled() && equalIgnoringCas e(nameValue, "brand-color") && document().frame())
478 document().frame()->loader().client()->dispatchDidChangeBrandColor() ;
474 } 479 }
475 480
476 // Get the document to process the tag, but only if we're actually part of D OM 481 // Get the document to process the tag, but only if we're actually part of D OM
477 // tree (changing a meta tag while it's not in the tree shouldn't have any e ffect 482 // tree (changing a meta tag while it's not in the tree shouldn't have any e ffect
478 // on the document). 483 // on the document).
479 484
480 const AtomicString& httpEquivValue = fastGetAttribute(http_equivAttr); 485 const AtomicString& httpEquivValue = fastGetAttribute(http_equivAttr);
481 if (!httpEquivValue.isEmpty()) 486 if (!httpEquivValue.isEmpty())
482 document().processHttpEquiv(httpEquivValue, contentValue, inDocumentHead (this)); 487 document().processHttpEquiv(httpEquivValue, contentValue, inDocumentHead (this));
483 } 488 }
484 489
485 const AtomicString& HTMLMetaElement::content() const 490 const AtomicString& HTMLMetaElement::content() const
486 { 491 {
487 return getAttribute(contentAttr); 492 return getAttribute(contentAttr);
488 } 493 }
489 494
490 const AtomicString& HTMLMetaElement::httpEquiv() const 495 const AtomicString& HTMLMetaElement::httpEquiv() const
491 { 496 {
492 return getAttribute(http_equivAttr); 497 return getAttribute(http_equivAttr);
493 } 498 }
494 499
495 const AtomicString& HTMLMetaElement::name() const 500 const AtomicString& HTMLMetaElement::name() const
496 { 501 {
497 return getNameAttribute(); 502 return getNameAttribute();
498 } 503 }
499 504
500 } 505 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698