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

Side by Side Diff: third_party/WebKit/Source/core/inspector/LayoutEditor.cpp

Issue 1767883002: DevTools: generate string16-based handlers for v8_inspector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: for landing 2 Created 4 years, 9 months 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/inspector/LayoutEditor.h" 5 #include "core/inspector/LayoutEditor.h"
6 6
7 #include "bindings/core/v8/ScriptController.h" 7 #include "bindings/core/v8/ScriptController.h"
8 #include "core/css/CSSComputedStyleDeclaration.h" 8 #include "core/css/CSSComputedStyleDeclaration.h"
9 #include "core/css/CSSImportRule.h" 9 #include "core/css/CSSImportRule.h"
10 #include "core/css/CSSMediaRule.h" 10 #include "core/css/CSSMediaRule.h"
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 InspectorHighlight highlight(element, config, false); 401 InspectorHighlight highlight(element, config, false);
402 highlights->pushValue(highlight.asProtocolValue()); 402 highlights->pushValue(highlight.asProtocolValue());
403 } 403 }
404 404
405 object->setArray("nodes", highlights.release()); 405 object->setArray("nodes", highlights.release());
406 return object.release(); 406 return object.release();
407 } 407 }
408 408
409 bool LayoutEditor::setCSSPropertyValueInCurrentRule(const String& value) 409 bool LayoutEditor::setCSSPropertyValueInCurrentRule(const String& value)
410 { 410 {
411 String errorString; 411 ErrorString errorString;
412 m_cssAgent->setLayoutEditorValue(&errorString, m_element.get(), m_matchedSty les.at(m_currentRuleIndex), m_changingProperty, value, false); 412 m_cssAgent->setLayoutEditorValue(&errorString, m_element.get(), m_matchedSty les.at(m_currentRuleIndex), m_changingProperty, value, false);
413 return errorString.isEmpty(); 413 return errorString.isEmpty();
414 } 414 }
415 415
416 void LayoutEditor::evaluateInOverlay(const String& method, PassOwnPtr<protocol:: Value> argument) const 416 void LayoutEditor::evaluateInOverlay(const String& method, PassOwnPtr<protocol:: Value> argument) const
417 { 417 {
418 ScriptForbiddenScope::AllowUserAgentScript allowScript; 418 ScriptForbiddenScope::AllowUserAgentScript allowScript;
419 OwnPtr<protocol::ListValue> command = protocol::ListValue::create(); 419 OwnPtr<protocol::ListValue> command = protocol::ListValue::create();
420 command->pushValue(protocol::StringValue::create(method)); 420 command->pushValue(protocol::StringValue::create(method));
421 command->pushValue(argument); 421 command->pushValue(argument);
422 m_scriptController->executeScriptInMainWorld("dispatch(" + command->toJSONSt ring() + ")", ScriptController::ExecuteScriptWhenScriptsDisabled); 422 m_scriptController->executeScriptInMainWorld("dispatch(" + command->toJSONSt ring() + ")", ScriptController::ExecuteScriptWhenScriptsDisabled);
423 } 423 }
424 424
425 } // namespace blink 425 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698