Web Inspector: TabBar redesign: remove top-level search field and pin the Search tab
authormattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Feb 2018 22:06:01 +0000 (22:06 +0000)
committermattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Feb 2018 22:06:01 +0000 (22:06 +0000)
commit4de79b621e0045c40405709e0ad0fb228ee4d459
tree19a8b7884be626f81f3966b678f3b4a72b4244d9
parentd80703a15dcf0572894b2d5c7b4f948a43b7b081
Web Inspector: TabBar redesign: remove top-level search field and pin the Search tab
https://bugs.webkit.org/show_bug.cgi?id=182353
<rdar://problem/37088644>

Reviewed by Devin Rousso.

* Localizations/en.lproj/localizedStrings.js:

* UserInterface/Base/Main.js:
(WI.contentLoaded):
Create Search UI based on experimental setting. When the new TabBar is
enabled, the Search tab is a pinned tab. Since it is also saveable, it
needs to be added to the TabBrowser (the browser adds the item to the bar).

When restoring saved tabs, make an additional check to prevent a tab
from being added twice. This can occur now that the Search tab is pinned.

* UserInterface/Images/Search.svg:
Update art to better match Safari/macOS. Slightly increase the radius of
the lens, and shorten the length of the handle.

* UserInterface/Views/GoToLineDialog.css:
(.go-to-line-dialog > div::before):
Update styles for new Search icon.

* UserInterface/Views/LegacyTabBar.js:
(WI.LegacyTabBar.prototype.get saveableTabCount):
Backported new TabBar method which is called by TabBrowser.

* UserInterface/Views/OpenResourceDialog.css:
(.open-resource-dialog > .field::before):
Update styles for new Search icon.

* UserInterface/Views/PinnedTabBarItem.js:
(WI.PinnedTabBarItem.prototype.fromTabInfo):
Match GeneralTabBarItem.fromTabInfo.

* UserInterface/Views/SearchTabContentView.js:
(WI.SearchTabContentView):
(WI.SearchTabContentView.tabInfo):
New image (magnifying glass without border) when new TabBar is enabled.

* UserInterface/Views/SettingsTabContentView.js:
(WI.SettingsTabContentView):

* UserInterface/Views/TabBar.js:
(WI.TabBar):
Move creation of the Settings item out of TabBar. The TabBar should
only be concerned with managing tabs.

(WI.TabBar.prototype.get saveableTabCount):
(WI.TabBar.prototype._handleContextMenu):
(WI.TabBar.prototype.get normalNonEphemeralTabCount): Deleted.
Now that the Search tab is pinned, there aren't any normal tabs that
are also ephemeral. For the LegacyTabBar, both the Search and New Tab
tabs are still in this category.

* UserInterface/Views/TabBrowser.js:
(WI.TabBrowser.prototype.addTabForContentView):
(WI.TabBrowser.prototype.closeTabForContentView):
(WI.TabBrowser.prototype._tabBarItemSelected):
(WI.TabBrowser._tabBarItemRemoved):
Recent tab list should be validated against the list of saveable tabs,
since the Search tab is no longer a normal tab (a GeneralTabBarItem),
but is still persisted across Inspector sessions.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228581 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
Source/WebInspectorUI/UserInterface/Base/Main.js
Source/WebInspectorUI/UserInterface/Images/Search.svg
Source/WebInspectorUI/UserInterface/Views/GoToLineDialog.css
Source/WebInspectorUI/UserInterface/Views/LegacyTabBar.js
Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.css
Source/WebInspectorUI/UserInterface/Views/PinnedTabBarItem.js
Source/WebInspectorUI/UserInterface/Views/SearchTabContentView.js
Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js
Source/WebInspectorUI/UserInterface/Views/TabBar.js
Source/WebInspectorUI/UserInterface/Views/TabBrowser.js