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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/main/Main.js

Issue 2393763002: [DevTools] Cleanup DOMExtension.js. (Closed)
Patch Set: review comments Created 4 years, 2 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) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). 3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com).
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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 ]; 465 ];
466 section.addRelatedKeys(keys, WebInspector.UIString("Find next/previo us")); 466 section.addRelatedKeys(keys, WebInspector.UIString("Find next/previo us"));
467 } 467 }
468 }, 468 },
469 469
470 _postDocumentKeyDown: function(event) 470 _postDocumentKeyDown: function(event)
471 { 471 {
472 if (event.handled) 472 if (event.handled)
473 return; 473 return;
474 474
475 var target = event.deepActiveElement(); 475 var document = event.target && event.target.ownerDocument;
476 var target = document ? document.deepActiveElement() : null;
476 if (target) { 477 if (target) {
477 var anchor = target.enclosingNodeOrSelfWithNodeName("a"); 478 var anchor = target.enclosingNodeOrSelfWithNodeName("a");
478 if (anchor && anchor.preventFollow) 479 if (anchor && anchor.preventFollow)
479 event.preventDefault(); 480 event.preventDefault();
480 } 481 }
481 482
482 if (!WebInspector.Dialog.hasInstance() && WebInspector.inspectorView.cur rentPanel()) { 483 if (!WebInspector.Dialog.hasInstance() && WebInspector.inspectorView.cur rentPanel()) {
483 WebInspector.inspectorView.currentPanel().handleShortcut(event); 484 WebInspector.inspectorView.currentPanel().handleShortcut(event);
484 if (event.handled) { 485 if (event.handled) {
485 event.consume(true); 486 event.consume(true);
486 return; 487 return;
487 } 488 }
488 } 489 }
489 490
490 WebInspector.shortcutRegistry.handleShortcut(event); 491 WebInspector.shortcutRegistry.handleShortcut(event);
491 }, 492 },
492 493
493 /** 494 /**
494 * @param {!Event} event 495 * @param {!Event} event
495 */ 496 */
496 _redispatchClipboardEvent: function(event) 497 _redispatchClipboardEvent: function(event)
497 { 498 {
498 var eventCopy = new CustomEvent("clipboard-" + event.type); 499 var eventCopy = new CustomEvent("clipboard-" + event.type);
499 eventCopy["original"] = event; 500 eventCopy["original"] = event;
500 event.deepActiveElement().dispatchEvent(eventCopy); 501 var document = event.target && event.target.ownerDocument;
502 var target = document ? document.deepActiveElement() : null;
503 if (target)
504 target.dispatchEvent(eventCopy);
501 if (eventCopy.handled) 505 if (eventCopy.handled)
502 event.preventDefault(); 506 event.preventDefault();
503 }, 507 },
504 508
505 _contextMenuEventFired: function(event) 509 _contextMenuEventFired: function(event)
506 { 510 {
507 if (event.handled || event.target.classList.contains("popup-glasspane")) 511 if (event.handled || event.target.classList.contains("popup-glasspane"))
508 event.preventDefault(); 512 event.preventDefault();
509 }, 513 },
510 514
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
1110 * @override 1114 * @override
1111 * @return {?Element} 1115 * @return {?Element}
1112 */ 1116 */
1113 settingElement: function() 1117 settingElement: function()
1114 { 1118 {
1115 return WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIStri ng("Show rulers"), WebInspector.moduleSetting("showMetricsRulers")); 1119 return WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIStri ng("Show rulers"), WebInspector.moduleSetting("showMetricsRulers"));
1116 } 1120 }
1117 } 1121 }
1118 1122
1119 new WebInspector.Main(); 1123 new WebInspector.Main();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698