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

Side by Side Diff: third_party/WebKit/Source/core/frame/DOMVisualViewport.cpp

Issue 2096783004: Seperate visualviewportchanged event into scroll and resize events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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) 2016 Google Inc. All rights reserved. 2 * Copyright (C) 2016 Google 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 * * Redistributions of source code must retain the above copyright 7 * * 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 * * Redistributions in binary form must reproduce the above copyright 9 * * 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 26 matching lines...) Expand all
37 namespace blink { 37 namespace blink {
38 38
39 DOMVisualViewport::DOMVisualViewport(LocalDOMWindow* window) 39 DOMVisualViewport::DOMVisualViewport(LocalDOMWindow* window)
40 : m_window(window) {} 40 : m_window(window) {}
41 41
42 DEFINE_TRACE(DOMVisualViewport) 42 DEFINE_TRACE(DOMVisualViewport)
43 { 43 {
44 visitor->trace(m_window); 44 visitor->trace(m_window);
45 } 45 }
46 46
47 const AtomicString& DOMVisualViewport::interfaceName() const
48 {
49 return EventTargetNames::DOMVisualViewport;
50 }
51
52 ExecutionContext* DOMVisualViewport::getExecutionContext() const
53 {
54 return m_window->getExecutionContext();
55 }
56
47 double DOMVisualViewport::scrollLeft() 57 double DOMVisualViewport::scrollLeft()
48 { 58 {
49 LocalFrame* frame = m_window->frame(); 59 LocalFrame* frame = m_window->frame();
50 if (!frame || !frame->isMainFrame()) 60 if (!frame || !frame->isMainFrame())
51 return 0; 61 return 0;
52 62
53 if (FrameHost* host = frame->host()) 63 if (FrameHost* host = frame->host())
54 return host->visualViewport().scrollLeft(); 64 return host->visualViewport().scrollLeft();
55 65
56 return 0; 66 return 0;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 if (!frame->isMainFrame()) 141 if (!frame->isMainFrame())
132 return 1; 142 return 1;
133 143
134 if (FrameHost* host = m_window->frame()->host()) 144 if (FrameHost* host = m_window->frame()->host())
135 return host->visualViewport().pageScale(); 145 return host->visualViewport().pageScale();
136 146
137 return 0; 147 return 0;
138 } 148 }
139 149
140 } // namespace blink 150 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698