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

Side by Side Diff: Source/core/inspector/InspectorPageAgent.cpp

Issue 717003002: Animations: Allow document animation timelines to have a playback rate (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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
OLDNEW
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 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 18 matching lines...) Expand all
29 */ 29 */
30 30
31 #include "config.h" 31 #include "config.h"
32 #include "core/inspector/InspectorPageAgent.h" 32 #include "core/inspector/InspectorPageAgent.h"
33 33
34 #include "bindings/core/v8/DOMWrapperWorld.h" 34 #include "bindings/core/v8/DOMWrapperWorld.h"
35 #include "bindings/core/v8/ScriptController.h" 35 #include "bindings/core/v8/ScriptController.h"
36 #include "bindings/core/v8/ScriptRegexp.h" 36 #include "bindings/core/v8/ScriptRegexp.h"
37 #include "core/HTMLNames.h" 37 #include "core/HTMLNames.h"
38 #include "core/UserAgentStyleSheets.h" 38 #include "core/UserAgentStyleSheets.h"
39 #include "core/animation/AnimationTimeline.h"
39 #include "core/css/StyleSheetContents.h" 40 #include "core/css/StyleSheetContents.h"
40 #include "core/css/resolver/StyleResolver.h" 41 #include "core/css/resolver/StyleResolver.h"
41 #include "core/css/resolver/ViewportStyleResolver.h" 42 #include "core/css/resolver/ViewportStyleResolver.h"
42 #include "core/dom/DOMImplementation.h" 43 #include "core/dom/DOMImplementation.h"
43 #include "core/dom/Document.h" 44 #include "core/dom/Document.h"
44 #include "core/fetch/CSSStyleSheetResource.h" 45 #include "core/fetch/CSSStyleSheetResource.h"
45 #include "core/fetch/FontResource.h" 46 #include "core/fetch/FontResource.h"
46 #include "core/fetch/ImageResource.h" 47 #include "core/fetch/ImageResource.h"
47 #include "core/fetch/MemoryCache.h" 48 #include "core/fetch/MemoryCache.h"
48 #include "core/fetch/Resource.h" 49 #include "core/fetch/Resource.h"
(...skipping 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after
1468 { 1469 {
1469 m_state->setBoolean(PageAgentState::screencastEnabled, false); 1470 m_state->setBoolean(PageAgentState::screencastEnabled, false);
1470 } 1471 }
1471 1472
1472 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co nst bool* showGrid) 1473 void InspectorPageAgent::setShowViewportSizeOnResize(ErrorString*, bool show, co nst bool* showGrid)
1473 { 1474 {
1474 m_state->setBoolean(PageAgentState::showSizeOnResize, show); 1475 m_state->setBoolean(PageAgentState::showSizeOnResize, show);
1475 m_state->setBoolean(PageAgentState::showGridOnResize, asBool(showGrid)); 1476 m_state->setBoolean(PageAgentState::showGridOnResize, asBool(showGrid));
1476 } 1477 }
1477 1478
1479 void InspectorPageAgent::setAnimationsPlaybackRate(ErrorString*, double playback Rate)
1480 {
1481 WillBeHeapVector<RefPtrWillBeMember<Document>> documents;
1482 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traver seNext()) {
1483 if (frame->isLocalFrame())
1484 documents.append(toLocalFrame(frame)->document());
1485 }
1486 for (auto& document : documents)
1487 document->timeline().setPlaybackRateForInspector(playbackRate);
alancutter (OOO until 2018) 2014/11/12 03:19:18 No need for vector, just perform this operation in
samli 2014/11/12 20:01:13 Done.
1488 }
1489
1478 void InspectorPageAgent::clearEditedResourcesContent() 1490 void InspectorPageAgent::clearEditedResourcesContent()
1479 { 1491 {
1480 m_editedResourceContent.clear(); 1492 m_editedResourceContent.clear();
1481 } 1493 }
1482 1494
1483 void InspectorPageAgent::addEditedResourceContent(const String& url, const Strin g& content) 1495 void InspectorPageAgent::addEditedResourceContent(const String& url, const Strin g& content)
1484 { 1496 {
1485 m_editedResourceContent.set(url, content); 1497 m_editedResourceContent.set(url, content);
1486 } 1498 }
1487 1499
1488 bool InspectorPageAgent::getEditedResourceContent(const String& url, String* con tent) 1500 bool InspectorPageAgent::getEditedResourceContent(const String& url, String* con tent)
1489 { 1501 {
1490 if (!m_editedResourceContent.contains(url)) 1502 if (!m_editedResourceContent.contains(url))
1491 return false; 1503 return false;
1492 *content = m_editedResourceContent.get(url); 1504 *content = m_editedResourceContent.get(url);
1493 return true; 1505 return true;
1494 } 1506 }
1495 1507
1496 void InspectorPageAgent::trace(Visitor* visitor) 1508 void InspectorPageAgent::trace(Visitor* visitor)
1497 { 1509 {
1498 visitor->trace(m_page); 1510 visitor->trace(m_page);
1499 visitor->trace(m_injectedScriptManager); 1511 visitor->trace(m_injectedScriptManager);
1500 visitor->trace(m_inspectorResourceContentLoader); 1512 visitor->trace(m_inspectorResourceContentLoader);
1501 InspectorBaseAgent::trace(visitor); 1513 InspectorBaseAgent::trace(visitor);
1502 } 1514 }
1503 1515
1504 } // namespace blink 1516 } // namespace blink
1505 1517
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698