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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sources/NavigatorView.js

Issue 2377193004: [DevTools] Rework some focus code. (Closed)
Patch Set: fixes 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 10 *
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after
972 { 972 {
973 this._warmedUpContent = content; 973 this._warmedUpContent = content;
974 } 974 }
975 }, 975 },
976 976
977 _shouldRenameOnMouseDown: function() 977 _shouldRenameOnMouseDown: function()
978 { 978 {
979 if (!this._uiSourceCode.canRename()) 979 if (!this._uiSourceCode.canRename())
980 return false; 980 return false;
981 var isSelected = this === this.treeOutline.selectedTreeElement; 981 var isSelected = this === this.treeOutline.selectedTreeElement;
982 var document = this.treeOutline.element.ownerDocument; 982 return isSelected && this.treeOutline.element.hasFocus() && !WebInspecto r.isBeingEdited(this.treeOutline.element);
983 var isFocused = this.treeOutline.element.isSelfOrAncestor(document.activ eElement);
984 return isSelected && isFocused && !WebInspector.isBeingEdited(this.treeO utline.element);
985 }, 983 },
986 984
987 selectOnMouseDown: function(event) 985 selectOnMouseDown: function(event)
988 { 986 {
989 if (event.which !== 1 || !this._shouldRenameOnMouseDown()) { 987 if (event.which !== 1 || !this._shouldRenameOnMouseDown()) {
990 TreeElement.prototype.selectOnMouseDown.call(this, event); 988 TreeElement.prototype.selectOnMouseDown.call(this, event);
991 return; 989 return;
992 } 990 }
993 setTimeout(rename.bind(this), 300); 991 setTimeout(rename.bind(this), 300);
994 992
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
1597 { 1595 {
1598 if (this._treeElement) 1596 if (this._treeElement)
1599 return this._treeElement; 1597 return this._treeElement;
1600 this._treeElement = new WebInspector.NavigatorFolderTreeElement(this._na vigatorView, this._type, this._title, this._hoverCallback); 1598 this._treeElement = new WebInspector.NavigatorFolderTreeElement(this._na vigatorView, this._type, this._title, this._hoverCallback);
1601 this._treeElement.setNode(this); 1599 this._treeElement.setNode(this);
1602 return this._treeElement; 1600 return this._treeElement;
1603 }, 1601 },
1604 1602
1605 __proto__: WebInspector.NavigatorTreeNode.prototype 1603 __proto__: WebInspector.NavigatorTreeNode.prototype
1606 } 1604 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698