| OLD | NEW |
| 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 "modules/device_orientation/DeviceOrientationInspectorAgent.h" | 5 #include "modules/device_orientation/DeviceOrientationInspectorAgent.h" |
| 6 | 6 |
| 7 #include "core/frame/LocalFrame.h" | 7 #include "core/frame/LocalFrame.h" |
| 8 #include "core/page/Page.h" | 8 #include "core/page/Page.h" |
| 9 #include "modules/device_orientation/DeviceOrientationController.h" | 9 #include "modules/device_orientation/DeviceOrientationController.h" |
| 10 #include "modules/device_orientation/DeviceOrientationData.h" | 10 #include "modules/device_orientation/DeviceOrientationData.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 DeviceOrientationInspectorAgent* DeviceOrientationInspectorAgent::create(Page* p
age) | 23 DeviceOrientationInspectorAgent* DeviceOrientationInspectorAgent::create(Page* p
age) |
| 24 { | 24 { |
| 25 return new DeviceOrientationInspectorAgent(*page); | 25 return new DeviceOrientationInspectorAgent(*page); |
| 26 } | 26 } |
| 27 | 27 |
| 28 DeviceOrientationInspectorAgent::~DeviceOrientationInspectorAgent() | 28 DeviceOrientationInspectorAgent::~DeviceOrientationInspectorAgent() |
| 29 { | 29 { |
| 30 } | 30 } |
| 31 | 31 |
| 32 DeviceOrientationInspectorAgent::DeviceOrientationInspectorAgent(Page& page) | 32 DeviceOrientationInspectorAgent::DeviceOrientationInspectorAgent(Page& page) |
| 33 : InspectorBaseAgent<DeviceOrientationInspectorAgent, protocol::Frontend::De
viceOrientation>("DeviceOrientation") | 33 : InspectorBaseAgent<DeviceOrientationInspectorAgent, protocol::DeviceOrient
ation::Frontend>("DeviceOrientation") |
| 34 , m_page(&page) | 34 , m_page(&page) |
| 35 { | 35 { |
| 36 } | 36 } |
| 37 | 37 |
| 38 DEFINE_TRACE(DeviceOrientationInspectorAgent) | 38 DEFINE_TRACE(DeviceOrientationInspectorAgent) |
| 39 { | 39 { |
| 40 visitor->trace(m_page); | 40 visitor->trace(m_page); |
| 41 InspectorBaseAgent<DeviceOrientationInspectorAgent, protocol::Frontend::Devi
ceOrientation>::trace(visitor); | 41 InspectorBaseAgent<DeviceOrientationInspectorAgent, protocol::DeviceOrientat
ion::Frontend>::trace(visitor); |
| 42 } | 42 } |
| 43 | 43 |
| 44 DeviceOrientationController& DeviceOrientationInspectorAgent::controller() | 44 DeviceOrientationController& DeviceOrientationInspectorAgent::controller() |
| 45 { | 45 { |
| 46 DCHECK(toLocalFrame(m_page->mainFrame())->document()); | 46 DCHECK(toLocalFrame(m_page->mainFrame())->document()); |
| 47 return DeviceOrientationController::from(*m_page->deprecatedLocalMainFrame()
->document()); | 47 return DeviceOrientationController::from(*m_page->deprecatedLocalMainFrame()
->document()); |
| 48 } | 48 } |
| 49 | 49 |
| 50 void DeviceOrientationInspectorAgent::setDeviceOrientationOverride(ErrorString*
error, double alpha, double beta, double gamma) | 50 void DeviceOrientationInspectorAgent::setDeviceOrientationOverride(ErrorString*
error, double alpha, double beta, double gamma) |
| 51 { | 51 { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 // FIXME(dgozman): adapt this for out-of-process iframes. | 86 // FIXME(dgozman): adapt this for out-of-process iframes. |
| 87 if (frame != m_page->mainFrame()) | 87 if (frame != m_page->mainFrame()) |
| 88 return; | 88 return; |
| 89 | 89 |
| 90 // New document in main frame - apply override there. | 90 // New document in main frame - apply override there. |
| 91 // No need to cleanup previous one, as it's already gone. | 91 // No need to cleanup previous one, as it's already gone. |
| 92 restore(); | 92 restore(); |
| 93 } | 93 } |
| 94 | 94 |
| 95 } // namespace blink | 95 } // namespace blink |
| OLD | NEW |