| 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::DeviceOrient
ation::Frontend>("DeviceOrientation") | 33 : m_page(&page) |
| 34 , m_page(&page) | |
| 35 { | 34 { |
| 36 } | 35 } |
| 37 | 36 |
| 38 DEFINE_TRACE(DeviceOrientationInspectorAgent) | 37 DEFINE_TRACE(DeviceOrientationInspectorAgent) |
| 39 { | 38 { |
| 40 visitor->trace(m_page); | 39 visitor->trace(m_page); |
| 41 InspectorBaseAgent<DeviceOrientationInspectorAgent, protocol::DeviceOrientat
ion::Frontend>::trace(visitor); | 40 InspectorBaseAgent::trace(visitor); |
| 42 } | 41 } |
| 43 | 42 |
| 44 DeviceOrientationController& DeviceOrientationInspectorAgent::controller() | 43 DeviceOrientationController& DeviceOrientationInspectorAgent::controller() |
| 45 { | 44 { |
| 46 DCHECK(toLocalFrame(m_page->mainFrame())->document()); | 45 DCHECK(toLocalFrame(m_page->mainFrame())->document()); |
| 47 return DeviceOrientationController::from(*m_page->deprecatedLocalMainFrame()
->document()); | 46 return DeviceOrientationController::from(*m_page->deprecatedLocalMainFrame()
->document()); |
| 48 } | 47 } |
| 49 | 48 |
| 50 void DeviceOrientationInspectorAgent::setDeviceOrientationOverride(ErrorString*
error, double alpha, double beta, double gamma) | 49 void DeviceOrientationInspectorAgent::setDeviceOrientationOverride(ErrorString*
error, double alpha, double beta, double gamma) |
| 51 { | 50 { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 // FIXME(dgozman): adapt this for out-of-process iframes. | 85 // FIXME(dgozman): adapt this for out-of-process iframes. |
| 87 if (frame != m_page->mainFrame()) | 86 if (frame != m_page->mainFrame()) |
| 88 return; | 87 return; |
| 89 | 88 |
| 90 // New document in main frame - apply override there. | 89 // New document in main frame - apply override there. |
| 91 // No need to cleanup previous one, as it's already gone. | 90 // No need to cleanup previous one, as it's already gone. |
| 92 restore(); | 91 restore(); |
| 93 } | 92 } |
| 94 | 93 |
| 95 } // namespace blink | 94 } // namespace blink |
| OLD | NEW |