|
Lines 225-244
void InspectorController::setSetting(const String& key, const String& value)
a/WebCore/inspector/InspectorController.cpp_sec1
|
| 225 |
m_client->storeSetting(key, value); |
225 |
m_client->storeSetting(key, value); |
| 226 |
} |
226 |
} |
| 227 |
|
227 |
|
| 228 |
// Trying to inspect something in a frame with JavaScript disabled would later lead to |
|
|
| 229 |
// crashes trying to create JavaScript wrappers. Some day we could fix this issue, but |
| 230 |
// for now prevent crashes here by never targeting a node in such a frame. |
| 231 |
static bool canPassNodeToJavaScript(Node* node) |
| 232 |
{ |
| 233 |
if (!node) |
| 234 |
return false; |
| 235 |
Frame* frame = node->document()->frame(); |
| 236 |
return frame && frame->script()->canExecuteScripts(NotAboutToExecuteScript); |
| 237 |
} |
| 238 |
|
| 239 |
void InspectorController::inspect(Node* node) |
228 |
void InspectorController::inspect(Node* node) |
| 240 |
{ |
229 |
{ |
| 241 |
if (!canPassNodeToJavaScript(node) || !enabled()) |
230 |
if (!enabled()) |
| 242 |
return; |
231 |
return; |
| 243 |
|
232 |
|
| 244 |
show(); |
233 |
show(); |
|
Lines 385-402
void InspectorController::mouseDidMoveOverElement(const HitTestResult& result, u
a/WebCore/inspector/InspectorController.cpp_sec2
|
| 385 |
highlight(node); |
374 |
highlight(node); |
| 386 |
} |
375 |
} |
| 387 |
|
376 |
|
| 388 |
void InspectorController::handleMousePressOnNode(Node* node) |
377 |
void InspectorController::handleMousePress() |
| 389 |
{ |
378 |
{ |
| 390 |
if (!enabled()) |
379 |
if (!enabled()) |
| 391 |
return; |
380 |
return; |
| 392 |
|
381 |
|
| 393 |
ASSERT(m_searchingForNode); |
382 |
ASSERT(m_searchingForNode); |
| 394 |
ASSERT(node); |
383 |
if (!m_highlightedNode) |
| 395 |
if (!node) |
|
|
| 396 |
return; |
384 |
return; |
| 397 |
|
385 |
|
|
|
386 |
RefPtr<Node> node = m_highlightedNode; |
| 398 |
setSearchingForNode(false); |
387 |
setSearchingForNode(false); |
| 399 |
inspect(node); |
388 |
inspect(node.get()); |
| 400 |
} |
389 |
} |
| 401 |
|
390 |
|
| 402 |
void InspectorController::setInspectorFrontendClient(PassOwnPtr<InspectorFrontendClient> client) |
391 |
void InspectorController::setInspectorFrontendClient(PassOwnPtr<InspectorFrontendClient> client) |