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

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: 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 "core/dom/Document.h" 27 #include "core/dom/Document.h"
28 #include "core/frame/LocalFrame.h"
28 #include "core/frame/Settings.h" 29 #include "core/frame/Settings.h"
30 #include "core/loader/FrameLoaderClient.h"
29 31
30 namespace WebCore { 32 namespace WebCore {
31 33
32 #define DEFINE_ARRAY_FOR_MATCHING(name, source, maxMatchLength) \ 34 #define DEFINE_ARRAY_FOR_MATCHING(name, source, maxMatchLength) \
33 const UChar* name; \ 35 const UChar* name; \
34 const unsigned uMaxMatchLength = maxMatchLength; \ 36 const unsigned uMaxMatchLength = maxMatchLength; \
35 UChar characterBuffer[uMaxMatchLength]; \ 37 UChar characterBuffer[uMaxMatchLength]; \
36 if (!source.is8Bit()) { \ 38 if (!source.is8Bit()) { \
37 name = source.characters16(); \ 39 name = source.characters16(); \
38 } else { \ 40 } else { \
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 const AtomicString& nameValue = fastGetAttribute(nameAttr); 466 const AtomicString& nameValue = fastGetAttribute(nameAttr);
465 if (!nameValue.isEmpty()) { 467 if (!nameValue.isEmpty()) {
466 if (equalIgnoringCase(nameValue, "viewport")) 468 if (equalIgnoringCase(nameValue, "viewport"))
467 processViewportContentAttribute(contentValue, ViewportDescription::V iewportMeta); 469 processViewportContentAttribute(contentValue, ViewportDescription::V iewportMeta);
468 else if (equalIgnoringCase(nameValue, "referrer")) 470 else if (equalIgnoringCase(nameValue, "referrer"))
469 document().processReferrerPolicy(contentValue); 471 document().processReferrerPolicy(contentValue);
470 else if (equalIgnoringCase(nameValue, "handheldfriendly") && equalIgnori ngCase(contentValue, "true")) 472 else if (equalIgnoringCase(nameValue, "handheldfriendly") && equalIgnori ngCase(contentValue, "true"))
471 processViewportContentAttribute("width=device-width", ViewportDescri ption::HandheldFriendlyMeta); 473 processViewportContentAttribute("width=device-width", ViewportDescri ption::HandheldFriendlyMeta);
472 else if (equalIgnoringCase(nameValue, "mobileoptimized")) 474 else if (equalIgnoringCase(nameValue, "mobileoptimized"))
473 processViewportContentAttribute("width=device-width, initial-scale=1 ", ViewportDescription::MobileOptimizedMeta); 475 processViewportContentAttribute("width=device-width, initial-scale=1 ", ViewportDescription::MobileOptimizedMeta);
476 else if (equalIgnoringCase(nameValue, "brand-color") && document().frame () && document().frame()->loader().client())
abarth-chromium 2014/06/13 05:40:41 document().frame()->loader().client() is never zer
michaelbai 2014/06/13 19:56:51 Done.
477 document().frame()->loader().client()->dispatchDidChangeBrandColor() ;
474 } 478 }
475 479
476 // Get the document to process the tag, but only if we're actually part of D OM 480 // 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 481 // tree (changing a meta tag while it's not in the tree shouldn't have any e ffect
478 // on the document). 482 // on the document).
479 483
480 const AtomicString& httpEquivValue = fastGetAttribute(http_equivAttr); 484 const AtomicString& httpEquivValue = fastGetAttribute(http_equivAttr);
481 if (!httpEquivValue.isEmpty()) 485 if (!httpEquivValue.isEmpty())
482 document().processHttpEquiv(httpEquivValue, contentValue, inDocumentHead (this)); 486 document().processHttpEquiv(httpEquivValue, contentValue, inDocumentHead (this));
483 } 487 }
484 488
485 const AtomicString& HTMLMetaElement::content() const 489 const AtomicString& HTMLMetaElement::content() const
486 { 490 {
487 return getAttribute(contentAttr); 491 return getAttribute(contentAttr);
488 } 492 }
489 493
490 const AtomicString& HTMLMetaElement::httpEquiv() const 494 const AtomicString& HTMLMetaElement::httpEquiv() const
491 { 495 {
492 return getAttribute(http_equivAttr); 496 return getAttribute(http_equivAttr);
493 } 497 }
494 498
495 const AtomicString& HTMLMetaElement::name() const 499 const AtomicString& HTMLMetaElement::name() const
496 { 500 {
497 return getNameAttribute(); 501 return getNameAttribute();
498 } 502 }
499 503
500 } 504 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698