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

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

Issue 2698723002: Add rappor logging for Device Orientation on security origins different from the main frame (Closed)
Patch Set: add DEviceMotion Created 3 years, 9 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/frame/DeviceSingleWindowEventController.h" 5 #include "core/frame/DeviceSingleWindowEventController.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/events/Event.h" 8 #include "core/events/Event.h"
9 #include "core/page/Page.h" 9 #include "core/page/Page.h"
10 10
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 stopUpdating(); 61 stopUpdating();
62 m_hasEventListener = false; 62 m_hasEventListener = false;
63 } 63 }
64 64
65 void DeviceSingleWindowEventController::didRemoveAllEventListeners( 65 void DeviceSingleWindowEventController::didRemoveAllEventListeners(
66 LocalDOMWindow*) { 66 LocalDOMWindow*) {
67 stopUpdating(); 67 stopUpdating();
68 m_hasEventListener = false; 68 m_hasEventListener = false;
69 } 69 }
70 70
71 bool DeviceSingleWindowEventController::isSameSecurityOriginAsMainFrame()
72 const {
73 if (!document().frame() || !document().page())
74 return false;
75
76 if (document().frame()->isMainFrame())
77 return true;
78
79 SecurityOrigin* mainSecurityOrigin =
80 document().page()->mainFrame()->securityContext()->getSecurityOrigin();
81
82 if (mainSecurityOrigin &&
83 document().getSecurityOrigin()->canAccess(mainSecurityOrigin))
84 return true;
85
86 return false;
87 }
88
71 DEFINE_TRACE(DeviceSingleWindowEventController) { 89 DEFINE_TRACE(DeviceSingleWindowEventController) {
72 visitor->trace(m_document); 90 visitor->trace(m_document);
73 PlatformEventController::trace(visitor); 91 PlatformEventController::trace(visitor);
74 } 92 }
75 93
76 } // namespace blink 94 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698