OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010-2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2010-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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 if (m_attached) | 225 if (m_attached) |
226 blink::Platform::current()->currentThread()->removeTaskObserver(this); | 226 blink::Platform::current()->currentThread()->removeTaskObserver(this); |
227 } | 227 } |
228 | 228 |
229 void WebDevToolsAgentImpl::attach() | 229 void WebDevToolsAgentImpl::attach() |
230 { | 230 { |
231 if (m_attached) | 231 if (m_attached) |
232 return; | 232 return; |
233 | 233 |
234 inspectorController()->connectFrontend(this); | 234 inspectorController()->connectFrontend(this); |
235 inspectorController()->webViewResized(m_webViewImpl->size()); | |
236 blink::Platform::current()->currentThread()->addTaskObserver(this); | 235 blink::Platform::current()->currentThread()->addTaskObserver(this); |
237 m_attached = true; | 236 m_attached = true; |
238 } | 237 } |
239 | 238 |
240 void WebDevToolsAgentImpl::reattach(const WebString& savedState) | 239 void WebDevToolsAgentImpl::reattach(const WebString& savedState) |
241 { | 240 { |
242 if (m_attached) | 241 if (m_attached) |
243 return; | 242 return; |
244 | 243 |
245 inspectorController()->reuseFrontend(this, savedState); | 244 inspectorController()->reuseFrontend(this, savedState); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 | 290 |
292 void WebDevToolsAgentImpl::didCreateScriptContext(WebLocalFrameImpl* webframe, i
nt worldId) | 291 void WebDevToolsAgentImpl::didCreateScriptContext(WebLocalFrameImpl* webframe, i
nt worldId) |
293 { | 292 { |
294 // Skip non main world contexts. | 293 // Skip non main world contexts. |
295 if (worldId) | 294 if (worldId) |
296 return; | 295 return; |
297 if (WebCore::LocalFrame* frame = webframe->frame()) | 296 if (WebCore::LocalFrame* frame = webframe->frame()) |
298 frame->script().setContextDebugId(m_hostId); | 297 frame->script().setContextDebugId(m_hostId); |
299 } | 298 } |
300 | 299 |
301 void WebDevToolsAgentImpl::webViewResized(const WebSize& size) | |
302 { | |
303 if (InspectorController* ic = inspectorController()) | |
304 ic->webViewResized(IntSize()); | |
305 } | |
306 | |
307 bool WebDevToolsAgentImpl::handleInputEvent(WebCore::Page* page, const WebInputE
vent& inputEvent) | 300 bool WebDevToolsAgentImpl::handleInputEvent(WebCore::Page* page, const WebInputE
vent& inputEvent) |
308 { | 301 { |
309 if (!m_attached && !m_generatingEvent) | 302 if (!m_attached && !m_generatingEvent) |
310 return false; | 303 return false; |
311 | 304 |
312 // FIXME: This workaround is required for touch emulation on Mac, where | 305 // FIXME: This workaround is required for touch emulation on Mac, where |
313 // compositor-side pinch handling is not enabled. See http://crbug.com/13800
3. | 306 // compositor-side pinch handling is not enabled. See http://crbug.com/13800
3. |
314 bool isPinch = inputEvent.type == WebInputEvent::GesturePinchBegin || inputE
vent.type == WebInputEvent::GesturePinchUpdate || inputEvent.type == WebInputEve
nt::GesturePinchEnd; | 307 bool isPinch = inputEvent.type == WebInputEvent::GesturePinchBegin || inputE
vent.type == WebInputEvent::GesturePinchUpdate || inputEvent.type == WebInputEve
nt::GesturePinchEnd; |
315 if (isPinch && m_touchEventEmulationEnabled && m_emulateViewportEnabled) { | 308 if (isPinch && m_touchEventEmulationEnabled && m_emulateViewportEnabled) { |
316 FrameView* frameView = page->mainFrame()->view(); | 309 FrameView* frameView = page->mainFrame()->view(); |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
728 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_removeBreakpointCmd) | 721 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_removeBreakpointCmd) |
729 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointsActiveCmd); | 722 || commandName == InspectorBackendDispatcher::commandName(InspectorBacke
ndDispatcher::kDebugger_setBreakpointsActiveCmd); |
730 } | 723 } |
731 | 724 |
732 void WebDevToolsAgent::processPendingMessages() | 725 void WebDevToolsAgent::processPendingMessages() |
733 { | 726 { |
734 PageScriptDebugServer::shared().runPendingTasks(); | 727 PageScriptDebugServer::shared().runPendingTasks(); |
735 } | 728 } |
736 | 729 |
737 } // namespace blink | 730 } // namespace blink |
OLD | NEW |