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

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

Issue 879423003: Move Location to DOMWindow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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
« no previous file with comments | « no previous file | Source/core/editing/DOMSelection.cpp » ('j') | Source/core/frame/DOMWindow.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 23 matching lines...) Expand all
34 34
35 namespace blink { 35 namespace blink {
36 36
37 StyleMedia::StyleMedia(LocalFrame* frame) 37 StyleMedia::StyleMedia(LocalFrame* frame)
38 : DOMWindowProperty(frame) 38 : DOMWindowProperty(frame)
39 { 39 {
40 } 40 }
41 41
42 AtomicString StyleMedia::type() const 42 AtomicString StyleMedia::type() const
43 { 43 {
44 FrameView* view = m_frame ? m_frame->view() : 0; 44 FrameView* view = localFrame() ? localFrame()->view() : 0;
dcheng 2015/02/02 19:27:52 Nit: nullptr, since you're changing this anyway.
45 if (view) 45 if (view)
46 return view->mediaType(); 46 return view->mediaType();
47 47
48 return nullAtom; 48 return nullAtom;
49 } 49 }
50 50
51 bool StyleMedia::matchMedium(const String& query) const 51 bool StyleMedia::matchMedium(const String& query) const
52 { 52 {
53 if (!m_frame) 53 if (!localFrame())
54 return false; 54 return false;
55 55
56 Document* document = m_frame->document(); 56 Document* document = localFrame()->document();
57 ASSERT(document); 57 ASSERT(document);
58 Element* documentElement = document->documentElement(); 58 Element* documentElement = document->documentElement();
59 if (!documentElement) 59 if (!documentElement)
60 return false; 60 return false;
61 61
62 RefPtrWillBeRawPtr<MediaQuerySet> media = MediaQuerySet::create(); 62 RefPtrWillBeRawPtr<MediaQuerySet> media = MediaQuerySet::create();
63 if (!media->set(query)) 63 if (!media->set(query))
64 return false; 64 return false;
65 65
66 MediaQueryEvaluator screenEval(m_frame); 66 MediaQueryEvaluator screenEval(localFrame());
67 return screenEval.eval(media.get()); 67 return screenEval.eval(media.get());
68 } 68 }
69 69
70 void StyleMedia::trace(Visitor* visitor) 70 void StyleMedia::trace(Visitor* visitor)
71 { 71 {
72 DOMWindowProperty::trace(visitor); 72 DOMWindowProperty::trace(visitor);
73 } 73 }
74 74
75 } // namespace blink 75 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/editing/DOMSelection.cpp » ('j') | Source/core/frame/DOMWindow.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698