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

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

Issue 1310273006: Devtools: convert pair of booleans in setInspectModeEnabled into enum parameter (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address comments Created 5 years, 3 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 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after
1258 highlightConfig->padding = parseConfigColor("paddingColor", highlightInspect orObject); 1258 highlightConfig->padding = parseConfigColor("paddingColor", highlightInspect orObject);
1259 highlightConfig->border = parseConfigColor("borderColor", highlightInspector Object); 1259 highlightConfig->border = parseConfigColor("borderColor", highlightInspector Object);
1260 highlightConfig->margin = parseConfigColor("marginColor", highlightInspector Object); 1260 highlightConfig->margin = parseConfigColor("marginColor", highlightInspector Object);
1261 highlightConfig->eventTarget = parseConfigColor("eventTargetColor", highligh tInspectorObject); 1261 highlightConfig->eventTarget = parseConfigColor("eventTargetColor", highligh tInspectorObject);
1262 highlightConfig->shape = parseConfigColor("shapeColor", highlightInspectorOb ject); 1262 highlightConfig->shape = parseConfigColor("shapeColor", highlightInspectorOb ject);
1263 highlightConfig->shapeMargin = parseConfigColor("shapeMarginColor", highligh tInspectorObject); 1263 highlightConfig->shapeMargin = parseConfigColor("shapeMarginColor", highligh tInspectorObject);
1264 1264
1265 return highlightConfig.release(); 1265 return highlightConfig.release();
1266 } 1266 }
1267 1267
1268 void InspectorDOMAgent::setInspectModeEnabled(ErrorString* errorString, bool ena bled, const bool* inspectUAShadowDOM, const RefPtr<JSONObject>* highlightConfig) 1268 void InspectorDOMAgent::setInspectMode(ErrorString* errorString, const String& m ode, const RefPtr<JSONObject>* highlightConfig)
1269 { 1269 {
1270 if (enabled && !pushDocumentUponHandlelessOperation(errorString)) 1270 SearchMode searchMode;
1271 if (mode == TypeBuilder::getEnumConstantValue(TypeBuilder::DOM::InspectMode: :SearchForNode)) {
1272 searchMode = SearchingForNormal;
1273 } else if (mode == TypeBuilder::getEnumConstantValue(TypeBuilder::DOM::Inspe ctMode::SearchForUAShadowDOM)) {
1274 searchMode = SearchingForUAShadow;
1275 } else if (mode == TypeBuilder::getEnumConstantValue(TypeBuilder::DOM::Inspe ctMode::None)) {
1276 searchMode = NotSearching;
1277 } else {
1278 *errorString = "Unknown mode \"" + mode + "\" was provided.";
1271 return; 1279 return;
1272 SearchMode searchMode = enabled ? (asBool(inspectUAShadowDOM) ? SearchingFor UAShadow : SearchingForNormal) : NotSearching; 1280 }
1281
1282 if (searchMode != NotSearching && !pushDocumentUponHandlelessOperation(error String))
1283 return;
1284
1273 setSearchingForNode(errorString, searchMode, highlightConfig ? highlightConf ig->get() : nullptr); 1285 setSearchingForNode(errorString, searchMode, highlightConfig ? highlightConf ig->get() : nullptr);
1274 } 1286 }
1275 1287
1276 void InspectorDOMAgent::highlightRect(ErrorString*, int x, int y, int width, int height, const RefPtr<JSONObject>* color, const RefPtr<JSONObject>* outlineColor ) 1288 void InspectorDOMAgent::highlightRect(ErrorString*, int x, int y, int width, int height, const RefPtr<JSONObject>* color, const RefPtr<JSONObject>* outlineColor )
1277 { 1289 {
1278 OwnPtr<FloatQuad> quad = adoptPtr(new FloatQuad(FloatRect(x, y, width, heigh t))); 1290 OwnPtr<FloatQuad> quad = adoptPtr(new FloatQuad(FloatRect(x, y, width, heigh t)));
1279 innerHighlightQuad(quad.release(), color, outlineColor); 1291 innerHighlightQuad(quad.release(), color, outlineColor);
1280 } 1292 }
1281 1293
1282 void InspectorDOMAgent::highlightQuad(ErrorString* errorString, const RefPtr<JSO NArray>& quadArray, const RefPtr<JSONObject>* color, const RefPtr<JSONObject>* o utlineColor) 1294 void InspectorDOMAgent::highlightQuad(ErrorString* errorString, const RefPtr<JSO NArray>& quadArray, const RefPtr<JSONObject>* color, const RefPtr<JSONObject>* o utlineColor)
(...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after
2237 visitor->trace(m_revalidateTask); 2249 visitor->trace(m_revalidateTask);
2238 visitor->trace(m_searchResults); 2250 visitor->trace(m_searchResults);
2239 #endif 2251 #endif
2240 visitor->trace(m_hoveredNodeForInspectMode); 2252 visitor->trace(m_hoveredNodeForInspectMode);
2241 visitor->trace(m_history); 2253 visitor->trace(m_history);
2242 visitor->trace(m_domEditor); 2254 visitor->trace(m_domEditor);
2243 InspectorBaseAgent::trace(visitor); 2255 InspectorBaseAgent::trace(visitor);
2244 } 2256 }
2245 2257
2246 } // namespace blink 2258 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorDOMAgent.h ('k') | Source/devtools/front_end/components/InspectElementModeController.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698