| 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 if (mouseEvent.type() == WebInputEvent::MouseMove) | 255 if (mouseEvent.type() == WebInputEvent::MouseMove) |
| 256 handled = handleMouseMove(mouseEvent); | 256 handled = handleMouseMove(mouseEvent); |
| 257 else if (mouseEvent.type() == WebInputEvent::MouseDown) | 257 else if (mouseEvent.type() == WebInputEvent::MouseDown) |
| 258 handled = handleMousePress(); | 258 handled = handleMousePress(); |
| 259 | 259 |
| 260 if (handled) | 260 if (handled) |
| 261 return true; | 261 return true; |
| 262 | 262 |
| 263 if (mouseEvent.type() == WebInputEvent::MouseMove) { | 263 if (mouseEvent.type() == WebInputEvent::MouseMove) { |
| 264 handled = overlayMainFrame()->eventHandler().handleMouseMoveEvent( | 264 handled = overlayMainFrame()->eventHandler().handleMouseMoveEvent( |
| 265 mouseEvent, TransformWebMouseEventVector( | 265 mouseEvent, |
| 266 m_frameImpl->frameView(), | 266 TransformWebMouseEventVector( |
| 267 std::vector<const WebInputEvent*>())) != | 267 m_frameImpl->frameView(), |
| 268 std::vector<const WebInputEvent*>())) != |
| 268 WebInputEventResult::NotHandled; | 269 WebInputEventResult::NotHandled; |
| 269 } | 270 } |
| 270 if (mouseEvent.type() == WebInputEvent::MouseDown) | 271 if (mouseEvent.type() == WebInputEvent::MouseDown) |
| 271 handled = overlayMainFrame()->eventHandler().handleMousePressEvent( | 272 handled = overlayMainFrame()->eventHandler().handleMousePressEvent( |
| 272 mouseEvent) != WebInputEventResult::NotHandled; | 273 mouseEvent) != WebInputEventResult::NotHandled; |
| 273 if (mouseEvent.type() == WebInputEvent::MouseUp) | 274 if (mouseEvent.type() == WebInputEvent::MouseUp) |
| 274 handled = overlayMainFrame()->eventHandler().handleMouseReleaseEvent( | 275 handled = overlayMainFrame()->eventHandler().handleMouseReleaseEvent( |
| 275 mouseEvent) != WebInputEventResult::NotHandled; | 276 mouseEvent) != WebInputEventResult::NotHandled; |
| 276 } | 277 } |
| 277 | 278 |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 frame->setView(FrameView::create(*frame)); | 544 frame->setView(FrameView::create(*frame)); |
| 544 frame->init(); | 545 frame->init(); |
| 545 FrameLoader& loader = frame->loader(); | 546 FrameLoader& loader = frame->loader(); |
| 546 frame->view()->setCanHaveScrollbars(false); | 547 frame->view()->setCanHaveScrollbars(false); |
| 547 frame->view()->setTransparent(true); | 548 frame->view()->setTransparent(true); |
| 548 | 549 |
| 549 const WebData& overlayPageHTMLResource = | 550 const WebData& overlayPageHTMLResource = |
| 550 Platform::current()->loadResource("InspectorOverlayPage.html"); | 551 Platform::current()->loadResource("InspectorOverlayPage.html"); |
| 551 RefPtr<SharedBuffer> data = SharedBuffer::create( | 552 RefPtr<SharedBuffer> data = SharedBuffer::create( |
| 552 overlayPageHTMLResource.data(), overlayPageHTMLResource.size()); | 553 overlayPageHTMLResource.data(), overlayPageHTMLResource.size()); |
| 553 loader.load(FrameLoadRequest( | 554 loader.load(FrameLoadRequest(0, blankURL(), |
| 554 0, blankURL(), SubstituteData(data, "text/html", "UTF-8", KURL(), | 555 SubstituteData(data, "text/html", "UTF-8", |
| 555 ForceSynchronousLoad))); | 556 KURL(), ForceSynchronousLoad))); |
| 556 v8::Isolate* isolate = toIsolate(frame); | 557 v8::Isolate* isolate = toIsolate(frame); |
| 557 ScriptState* scriptState = ScriptState::forMainWorld(frame); | 558 ScriptState* scriptState = ScriptState::forMainWorld(frame); |
| 558 DCHECK(scriptState); | 559 DCHECK(scriptState); |
| 559 ScriptState::Scope scope(scriptState); | 560 ScriptState::Scope scope(scriptState); |
| 560 v8::Local<v8::Object> global = scriptState->context()->Global(); | 561 v8::Local<v8::Object> global = scriptState->context()->Global(); |
| 561 v8::Local<v8::Value> overlayHostObj = | 562 v8::Local<v8::Value> overlayHostObj = |
| 562 ToV8(m_overlayHost.get(), global, isolate); | 563 ToV8(m_overlayHost.get(), global, isolate); |
| 563 DCHECK(!overlayHostObj.IsEmpty()); | 564 DCHECK(!overlayHostObj.IsEmpty()); |
| 564 global | 565 global |
| 565 ->Set(scriptState->context(), | 566 ->Set(scriptState->context(), |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 bool InspectorOverlay::shouldSearchForNode() { | 786 bool InspectorOverlay::shouldSearchForNode() { |
| 786 return m_inspectMode != InspectorDOMAgent::NotSearching; | 787 return m_inspectMode != InspectorDOMAgent::NotSearching; |
| 787 } | 788 } |
| 788 | 789 |
| 789 void InspectorOverlay::inspect(Node* node) { | 790 void InspectorOverlay::inspect(Node* node) { |
| 790 if (m_domAgent) | 791 if (m_domAgent) |
| 791 m_domAgent->inspect(node); | 792 m_domAgent->inspect(node); |
| 792 } | 793 } |
| 793 | 794 |
| 794 } // namespace blink | 795 } // namespace blink |
| OLD | NEW |