Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: Source/modules/device_orientation/DeviceOrientationInspectorAgent.cpp

Issue 336553003: Change Page::m_mainFrame to be a Frame. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "config.h" 5 #include "config.h"
6 #include "modules/device_orientation/DeviceOrientationInspectorAgent.h" 6 #include "modules/device_orientation/DeviceOrientationInspectorAgent.h"
7 7
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/frame/LocalFrame.h" 9 #include "core/frame/LocalFrame.h"
10 #include "core/inspector/InspectorController.h" 10 #include "core/inspector/InspectorController.h"
(...skipping 23 matching lines...) Expand all
34 } 34 }
35 35
36 DeviceOrientationInspectorAgent::DeviceOrientationInspectorAgent(Page& page) 36 DeviceOrientationInspectorAgent::DeviceOrientationInspectorAgent(Page& page)
37 : InspectorBaseAgent<DeviceOrientationInspectorAgent>("DeviceOrientation") 37 : InspectorBaseAgent<DeviceOrientationInspectorAgent>("DeviceOrientation")
38 , m_page(page) 38 , m_page(page)
39 { 39 {
40 } 40 }
41 41
42 DeviceOrientationController& DeviceOrientationInspectorAgent::controller() 42 DeviceOrientationController& DeviceOrientationInspectorAgent::controller()
43 { 43 {
44 ASSERT(m_page.mainFrame()->document()); 44 ASSERT(toLocalFrame(m_page.mainFrame())->document());
45 return DeviceOrientationController::from(*m_page.mainFrame()->document()); 45 return DeviceOrientationController::from(*m_page.deprecatedLocalMainFrame()- >document());
46 } 46 }
47 47
48 void DeviceOrientationInspectorAgent::setDeviceOrientationOverride(ErrorString* error, double alpha, double beta, double gamma) 48 void DeviceOrientationInspectorAgent::setDeviceOrientationOverride(ErrorString* error, double alpha, double beta, double gamma)
49 { 49 {
50 m_state->setBoolean(DeviceOrientationInspectorAgentState::overrideEnabled, t rue); 50 m_state->setBoolean(DeviceOrientationInspectorAgentState::overrideEnabled, t rue);
51 m_state->setDouble(DeviceOrientationInspectorAgentState::alpha, alpha); 51 m_state->setDouble(DeviceOrientationInspectorAgentState::alpha, alpha);
52 m_state->setDouble(DeviceOrientationInspectorAgentState::beta, beta); 52 m_state->setDouble(DeviceOrientationInspectorAgentState::beta, beta);
53 m_state->setDouble(DeviceOrientationInspectorAgentState::gamma, gamma); 53 m_state->setDouble(DeviceOrientationInspectorAgentState::gamma, gamma);
54 controller().setOverride(DeviceOrientationData::create(true, alpha, true, be ta, true, gamma).get()); 54 controller().setOverride(DeviceOrientationData::create(true, alpha, true, be ta, true, gamma).get());
55 } 55 }
(...skipping 21 matching lines...) Expand all
77 } 77 }
78 78
79 void DeviceOrientationInspectorAgent::didCommitLoadForMainFrame() 79 void DeviceOrientationInspectorAgent::didCommitLoadForMainFrame()
80 { 80 {
81 // New document in main frame - apply override there. 81 // New document in main frame - apply override there.
82 // No need to cleanup previous one, as it's already gone. 82 // No need to cleanup previous one, as it's already gone.
83 restore(); 83 restore();
84 } 84 }
85 85
86 } // namespace WebCore 86 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/testing/Internals.cpp ('k') | Source/modules/filesystem/InspectorFrontendHostFileSystem.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698