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

Side by Side Diff: third_party/WebKit/Source/core/css/StyleMedia.cpp

Issue 2593983002: Replace DOMWindowProperty in core/ with ContextClient (Closed)
Patch Set: temp Created 3 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 15 matching lines...) Expand all
26 #include "core/css/StyleMedia.h" 26 #include "core/css/StyleMedia.h"
27 27
28 #include "core/css/MediaList.h" 28 #include "core/css/MediaList.h"
29 #include "core/css/MediaQueryEvaluator.h" 29 #include "core/css/MediaQueryEvaluator.h"
30 #include "core/dom/Document.h" 30 #include "core/dom/Document.h"
31 #include "core/frame/FrameView.h" 31 #include "core/frame/FrameView.h"
32 #include "core/frame/LocalFrame.h" 32 #include "core/frame/LocalFrame.h"
33 33
34 namespace blink { 34 namespace blink {
35 35
36 StyleMedia::StyleMedia(LocalFrame* frame) : DOMWindowProperty(frame) {} 36 StyleMedia::StyleMedia(LocalFrame* frame) : ContextClient(frame) {}
37 37
38 AtomicString StyleMedia::type() const { 38 AtomicString StyleMedia::type() const {
39 FrameView* view = frame() ? frame()->view() : nullptr; 39 FrameView* view = frame() ? frame()->view() : nullptr;
40 if (view) 40 if (view)
41 return view->mediaType(); 41 return view->mediaType();
42 42
43 return nullAtom; 43 return nullAtom;
44 } 44 }
45 45
46 bool StyleMedia::matchMedium(const String& query) const { 46 bool StyleMedia::matchMedium(const String& query) const {
47 if (!frame()) 47 if (!frame())
48 return false; 48 return false;
49 49
50 Document* document = frame()->document(); 50 Document* document = frame()->document();
51 ASSERT(document); 51 ASSERT(document);
52 Element* documentElement = document->documentElement(); 52 Element* documentElement = document->documentElement();
53 if (!documentElement) 53 if (!documentElement)
54 return false; 54 return false;
55 55
56 MediaQuerySet* media = MediaQuerySet::create(); 56 MediaQuerySet* media = MediaQuerySet::create();
57 if (!media->set(query)) 57 if (!media->set(query))
58 return false; 58 return false;
59 59
60 MediaQueryEvaluator screenEval(frame()); 60 MediaQueryEvaluator screenEval(frame());
61 return screenEval.eval(media); 61 return screenEval.eval(media);
62 } 62 }
63 63
64 DEFINE_TRACE(StyleMedia) { 64 DEFINE_TRACE(StyleMedia) {
65 DOMWindowProperty::trace(visitor); 65 ContextClient::trace(visitor);
66 } 66 }
67 67
68 } // namespace blink 68 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/StyleMedia.h ('k') | third_party/WebKit/Source/core/editing/DOMSelection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698