| 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 | 9 |
| 10 #include "modules/device_orientation/DeviceOrientationController.h" | 10 #include "modules/device_orientation/DeviceOrientationController.h" |
| 11 #include "modules/device_orientation/DeviceOrientationData.h" | 11 #include "modules/device_orientation/DeviceOrientationData.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 namespace DeviceOrientationInspectorAgentState { | 15 namespace DeviceOrientationInspectorAgentState { |
| 16 static const char alpha[] = "alpha"; | 16 static const char alpha[] = "alpha"; |
| 17 static const char beta[] = "beta"; | 17 static const char beta[] = "beta"; |
| 18 static const char gamma[] = "gamma"; | 18 static const char gamma[] = "gamma"; |
| 19 static const char overrideEnabled[] = "overrideEnabled"; | 19 static const char overrideEnabled[] = "overrideEnabled"; |
| 20 } | 20 } |
| 21 | 21 |
| 22 // static | 22 // static |
| 23 PassOwnPtrWillBeRawPtr<DeviceOrientationInspectorAgent> DeviceOrientationInspect
orAgent::create(Page* page) | 23 RawPtr<DeviceOrientationInspectorAgent> DeviceOrientationInspectorAgent::create(
Page* page) |
| 24 { | 24 { |
| 25 return adoptPtrWillBeNoop(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::Frontend::De
viceOrientation>("DeviceOrientation") |
| 34 , m_page(&page) | 34 , m_page(&page) |
| 35 { | 35 { |
| (...skipping 50 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 |