| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "core/inspector/InspectorPageAgent.h" | 32 #include "core/inspector/InspectorPageAgent.h" |
| 33 | 33 |
| 34 #include "HTMLNames.h" | 34 #include "HTMLNames.h" |
| 35 #include "InspectorFrontend.h" | 35 #include "InspectorFrontend.h" |
| 36 #include "bindings/v8/DOMWrapperWorld.h" | 36 #include "bindings/v8/DOMWrapperWorld.h" |
| 37 #include "bindings/v8/ScriptController.h" | 37 #include "bindings/v8/ScriptController.h" |
| 38 #include "core/dom/DOMImplementation.h" | 38 #include "core/dom/DOMImplementation.h" |
| 39 #include "core/dom/DeviceOrientationController.h" | |
| 40 #include "core/dom/Document.h" | 39 #include "core/dom/Document.h" |
| 41 #include "core/dom/UserGestureIndicator.h" | 40 #include "core/dom/UserGestureIndicator.h" |
| 42 #include "core/fetch/CSSStyleSheetResource.h" | 41 #include "core/fetch/CSSStyleSheetResource.h" |
| 43 #include "core/fetch/FontResource.h" | 42 #include "core/fetch/FontResource.h" |
| 44 #include "core/fetch/ImageResource.h" | 43 #include "core/fetch/ImageResource.h" |
| 45 #include "core/fetch/MemoryCache.h" | 44 #include "core/fetch/MemoryCache.h" |
| 46 #include "core/fetch/Resource.h" | 45 #include "core/fetch/Resource.h" |
| 47 #include "core/fetch/ResourceFetcher.h" | 46 #include "core/fetch/ResourceFetcher.h" |
| 48 #include "core/fetch/ScriptResource.h" | 47 #include "core/fetch/ScriptResource.h" |
| 49 #include "core/fetch/TextResourceDecoder.h" | 48 #include "core/fetch/TextResourceDecoder.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 62 #include "core/loader/FrameLoadRequest.h" | 61 #include "core/loader/FrameLoadRequest.h" |
| 63 #include "core/loader/FrameLoader.h" | 62 #include "core/loader/FrameLoader.h" |
| 64 #include "core/page/Frame.h" | 63 #include "core/page/Frame.h" |
| 65 #include "core/page/FrameView.h" | 64 #include "core/page/FrameView.h" |
| 66 #include "core/page/Page.h" | 65 #include "core/page/Page.h" |
| 67 #include "core/page/PageConsole.h" | 66 #include "core/page/PageConsole.h" |
| 68 #include "core/page/Settings.h" | 67 #include "core/page/Settings.h" |
| 69 #include "core/platform/Cookie.h" | 68 #include "core/platform/Cookie.h" |
| 70 #include "core/platform/JSONValues.h" | 69 #include "core/platform/JSONValues.h" |
| 71 #include "core/platform/text/RegularExpression.h" | 70 #include "core/platform/text/RegularExpression.h" |
| 71 #include "modules/device_orientation/NewDeviceOrientationController.h" |
| 72 #include "modules/geolocation/GeolocationController.h" | 72 #include "modules/geolocation/GeolocationController.h" |
| 73 #include "weborigin/SecurityOrigin.h" | 73 #include "weborigin/SecurityOrigin.h" |
| 74 #include "wtf/CurrentTime.h" | 74 #include "wtf/CurrentTime.h" |
| 75 #include "wtf/ListHashSet.h" | 75 #include "wtf/ListHashSet.h" |
| 76 #include "wtf/Vector.h" | 76 #include "wtf/Vector.h" |
| 77 #include "wtf/text/Base64.h" | 77 #include "wtf/text/Base64.h" |
| 78 #include "wtf/text/TextEncoding.h" | 78 #include "wtf/text/TextEncoding.h" |
| 79 | 79 |
| 80 namespace WebCore { | 80 namespace WebCore { |
| 81 | 81 |
| (...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1187 if (m_geolocationOverridden) { | 1187 if (m_geolocationOverridden) { |
| 1188 if (position) | 1188 if (position) |
| 1189 m_platformGeolocationPosition = position; | 1189 m_platformGeolocationPosition = position; |
| 1190 return m_geolocationPosition.get(); | 1190 return m_geolocationPosition.get(); |
| 1191 } | 1191 } |
| 1192 return position; | 1192 return position; |
| 1193 } | 1193 } |
| 1194 | 1194 |
| 1195 void InspectorPageAgent::setDeviceOrientationOverride(ErrorString* error, double
alpha, double beta, double gamma) | 1195 void InspectorPageAgent::setDeviceOrientationOverride(ErrorString* error, double
alpha, double beta, double gamma) |
| 1196 { | 1196 { |
| 1197 DeviceOrientationController* controller = DeviceOrientationController::from(
m_page); | 1197 NewDeviceOrientationController* controller = NewDeviceOrientationController:
:from(mainFrame()->document()); |
| 1198 if (!controller) { | 1198 if (!controller) { |
| 1199 *error = "Internal error: unable to override device orientation"; | 1199 *error = "Internal error: unable to override device orientation"; |
| 1200 return; | 1200 return; |
| 1201 } | 1201 } |
| 1202 | 1202 |
| 1203 ErrorString clearError; | 1203 ErrorString clearError; |
| 1204 clearDeviceOrientationOverride(&clearError); | 1204 clearDeviceOrientationOverride(&clearError); |
| 1205 | 1205 |
| 1206 m_deviceOrientation = DeviceOrientationData::create(true, alpha, true, beta,
true, gamma); | 1206 m_deviceOrientation = DeviceOrientationData::create(true, alpha, true, beta,
true, gamma); |
| 1207 controller->didChangeDeviceOrientation(m_deviceOrientation.get()); | 1207 controller->didChangeDeviceOrientation(m_deviceOrientation.get()); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1292 } | 1292 } |
| 1293 | 1293 |
| 1294 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co
nst bool* showGrid) | 1294 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co
nst bool* showGrid) |
| 1295 { | 1295 { |
| 1296 m_state->setBoolean(PageAgentState::showSizeOnResize, show); | 1296 m_state->setBoolean(PageAgentState::showSizeOnResize, show); |
| 1297 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid)
; | 1297 m_state->setBoolean(PageAgentState::showGridOnResize, showGrid && *showGrid)
; |
| 1298 } | 1298 } |
| 1299 | 1299 |
| 1300 } // namespace WebCore | 1300 } // namespace WebCore |
| 1301 | 1301 |
| OLD | NEW |