| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/screen_orientation/ScreenOrientationInspectorAgent.h" | 5 #include "modules/screen_orientation/ScreenOrientationInspectorAgent.h" |
| 6 | 6 |
| 7 #include "core/InspectorTypeBuilder.h" | 7 #include "core/InspectorTypeBuilder.h" |
| 8 #include "core/frame/LocalFrame.h" | 8 #include "core/frame/LocalFrame.h" |
| 9 #include "modules/screen_orientation/ScreenOrientation.h" | 9 #include "modules/screen_orientation/ScreenOrientation.h" |
| 10 #include "modules/screen_orientation/ScreenOrientationController.h" | 10 #include "modules/screen_orientation/ScreenOrientationController.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 if (type == TypeBuilder::getEnumConstantValue(TypeBuilder::ScreenOrientation
::OrientationType::LandscapePrimary)) | 28 if (type == TypeBuilder::getEnumConstantValue(TypeBuilder::ScreenOrientation
::OrientationType::LandscapePrimary)) |
| 29 return WebScreenOrientationLandscapePrimary; | 29 return WebScreenOrientationLandscapePrimary; |
| 30 if (type == TypeBuilder::getEnumConstantValue(TypeBuilder::ScreenOrientation
::OrientationType::LandscapeSecondary)) | 30 if (type == TypeBuilder::getEnumConstantValue(TypeBuilder::ScreenOrientation
::OrientationType::LandscapeSecondary)) |
| 31 return WebScreenOrientationLandscapeSecondary; | 31 return WebScreenOrientationLandscapeSecondary; |
| 32 return WebScreenOrientationUndefined; | 32 return WebScreenOrientationUndefined; |
| 33 } | 33 } |
| 34 | 34 |
| 35 } // namespace | 35 } // namespace |
| 36 | 36 |
| 37 // static | 37 // static |
| 38 PassOwnPtrWillBeRawPtr<ScreenOrientationInspectorAgent> ScreenOrientationInspect
orAgent::create(LocalFrame& frame) | 38 RawPtr<ScreenOrientationInspectorAgent> ScreenOrientationInspectorAgent::create(
LocalFrame& frame) |
| 39 { | 39 { |
| 40 return adoptPtrWillBeNoop(new ScreenOrientationInspectorAgent(frame)); | 40 return (new ScreenOrientationInspectorAgent(frame)); |
| 41 } | 41 } |
| 42 | 42 |
| 43 ScreenOrientationInspectorAgent::~ScreenOrientationInspectorAgent() | 43 ScreenOrientationInspectorAgent::~ScreenOrientationInspectorAgent() |
| 44 { | 44 { |
| 45 } | 45 } |
| 46 | 46 |
| 47 ScreenOrientationInspectorAgent::ScreenOrientationInspectorAgent(LocalFrame& fra
me) | 47 ScreenOrientationInspectorAgent::ScreenOrientationInspectorAgent(LocalFrame& fra
me) |
| 48 : InspectorBaseAgent<ScreenOrientationInspectorAgent, InspectorFrontend::Scr
eenOrientation>("ScreenOrientation") | 48 : InspectorBaseAgent<ScreenOrientationInspectorAgent, InspectorFrontend::Scr
eenOrientation>("ScreenOrientation") |
| 49 , m_frame(&frame) | 49 , m_frame(&frame) |
| 50 { | 50 { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 m_state->getNumber(ScreenOrientationInspectorAgentState::type, &longType
); | 103 m_state->getNumber(ScreenOrientationInspectorAgentState::type, &longType
); |
| 104 WebScreenOrientationType type = static_cast<WebScreenOrientationType>(lo
ngType); | 104 WebScreenOrientationType type = static_cast<WebScreenOrientationType>(lo
ngType); |
| 105 int angle = 0; | 105 int angle = 0; |
| 106 m_state->getNumber(ScreenOrientationInspectorAgentState::angle, &angle); | 106 m_state->getNumber(ScreenOrientationInspectorAgentState::angle, &angle); |
| 107 if (ScreenOrientationController* controller = ScreenOrientationControlle
r::from(*m_frame)) | 107 if (ScreenOrientationController* controller = ScreenOrientationControlle
r::from(*m_frame)) |
| 108 controller->setOverride(type, angle); | 108 controller->setOverride(type, angle); |
| 109 } | 109 } |
| 110 } | 110 } |
| 111 | 111 |
| 112 } // namespace blink | 112 } // namespace blink |
| OLD | NEW |