OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 m_nodeToInspectorStyleSheet.clear(); | 446 m_nodeToInspectorStyleSheet.clear(); |
447 m_documentToViaInspectorStyleSheet.clear(); | 447 m_documentToViaInspectorStyleSheet.clear(); |
448 resetNonPersistentData(); | 448 resetNonPersistentData(); |
449 } | 449 } |
450 | 450 |
451 void InspectorCSSAgent::resetNonPersistentData() | 451 void InspectorCSSAgent::resetNonPersistentData() |
452 { | 452 { |
453 resetPseudoStates(); | 453 resetPseudoStates(); |
454 } | 454 } |
455 | 455 |
456 void InspectorCSSAgent::enable(ErrorString*, PassRefPtrWillBeRawPtr<EnableCallba
ck> prpCallback) | 456 void InspectorCSSAgent::enable(ErrorString* errorString, PassRefPtrWillBeRawPtr<
EnableCallback> prpCallback) |
457 { | 457 { |
| 458 if (!m_domAgent->enabled()) { |
| 459 *errorString = "DOM agent needs to be enabled first."; |
| 460 return; |
| 461 } |
458 m_state->setBoolean(CSSAgentState::cssAgentEnabled, true); | 462 m_state->setBoolean(CSSAgentState::cssAgentEnabled, true); |
459 if (!m_pageAgent->resourceContentLoader()) { | 463 if (!m_pageAgent->resourceContentLoader()) { |
460 wasEnabled(); | 464 wasEnabled(); |
461 prpCallback->sendSuccess(); | 465 prpCallback->sendSuccess(); |
462 return; | 466 return; |
463 } | 467 } |
464 m_pageAgent->resourceContentLoader()->ensureResourcesContentLoaded(new Inspe
ctorCSSAgent::InspectorResourceContentLoaderCallback(this, prpCallback)); | 468 m_pageAgent->resourceContentLoader()->ensureResourcesContentLoaded(new Inspe
ctorCSSAgent::InspectorResourceContentLoaderCallback(this, prpCallback)); |
465 } | 469 } |
466 | 470 |
467 void InspectorCSSAgent::wasEnabled() | 471 void InspectorCSSAgent::wasEnabled() |
(...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1472 visitor->trace(m_invalidatedDocuments); | 1476 visitor->trace(m_invalidatedDocuments); |
1473 visitor->trace(m_nodeToInspectorStyleSheet); | 1477 visitor->trace(m_nodeToInspectorStyleSheet); |
1474 visitor->trace(m_documentToViaInspectorStyleSheet); | 1478 visitor->trace(m_documentToViaInspectorStyleSheet); |
1475 #endif | 1479 #endif |
1476 visitor->trace(m_inspectorUserAgentStyleSheet); | 1480 visitor->trace(m_inspectorUserAgentStyleSheet); |
1477 InspectorBaseAgent::trace(visitor); | 1481 InspectorBaseAgent::trace(visitor); |
1478 } | 1482 } |
1479 | 1483 |
1480 } // namespace blink | 1484 } // namespace blink |
1481 | 1485 |
OLD | NEW |