feat: add BrowserWindow.showAllTabs()
for macOS (#38965)
This commit is contained in:
parent
040e9a027a
commit
56b5c00312
11 changed files with 31 additions and 2 deletions
|
@ -915,6 +915,10 @@ void BaseWindow::SelectNextTab() {
|
|||
window_->SelectNextTab();
|
||||
}
|
||||
|
||||
void BaseWindow::ShowAllTabs() {
|
||||
window_->ShowAllTabs();
|
||||
}
|
||||
|
||||
void BaseWindow::MergeAllWindows() {
|
||||
window_->MergeAllWindows();
|
||||
}
|
||||
|
@ -1280,6 +1284,7 @@ void BaseWindow::BuildPrototype(v8::Isolate* isolate,
|
|||
#if BUILDFLAG(IS_MAC)
|
||||
.SetMethod("selectPreviousTab", &BaseWindow::SelectPreviousTab)
|
||||
.SetMethod("selectNextTab", &BaseWindow::SelectNextTab)
|
||||
.SetMethod("showAllTabs", &BaseWindow::ShowAllTabs)
|
||||
.SetMethod("mergeAllWindows", &BaseWindow::MergeAllWindows)
|
||||
.SetMethod("moveTabToNewWindow", &BaseWindow::MoveTabToNewWindow)
|
||||
.SetMethod("toggleTabBar", &BaseWindow::ToggleTabBar)
|
||||
|
|
|
@ -210,6 +210,7 @@ class BaseWindow : public gin_helper::TrackableObject<BaseWindow>,
|
|||
void SetEscapeTouchBarItem(gin_helper::PersistentDictionary item);
|
||||
void SelectPreviousTab();
|
||||
void SelectNextTab();
|
||||
void ShowAllTabs();
|
||||
void MergeAllWindows();
|
||||
void MoveTabToNewWindow();
|
||||
void ToggleTabBar();
|
||||
|
|
|
@ -457,6 +457,8 @@ void NativeWindow::SelectPreviousTab() {}
|
|||
|
||||
void NativeWindow::SelectNextTab() {}
|
||||
|
||||
void NativeWindow::ShowAllTabs() {}
|
||||
|
||||
void NativeWindow::MergeAllWindows() {}
|
||||
|
||||
void NativeWindow::MoveTabToNewWindow() {}
|
||||
|
|
|
@ -245,6 +245,7 @@ class NativeWindow : public base::SupportsUserData,
|
|||
// Native Tab API
|
||||
virtual void SelectPreviousTab();
|
||||
virtual void SelectNextTab();
|
||||
virtual void ShowAllTabs();
|
||||
virtual void MergeAllWindows();
|
||||
virtual void MoveTabToNewWindow();
|
||||
virtual void ToggleTabBar();
|
||||
|
|
|
@ -139,6 +139,7 @@ class NativeWindowMac : public NativeWindow,
|
|||
void SetEscapeTouchBarItem(gin_helper::PersistentDictionary item) override;
|
||||
void SelectPreviousTab() override;
|
||||
void SelectNextTab() override;
|
||||
void ShowAllTabs() override;
|
||||
void MergeAllWindows() override;
|
||||
void MoveTabToNewWindow() override;
|
||||
void ToggleTabBar() override;
|
||||
|
|
|
@ -1535,6 +1535,10 @@ void NativeWindowMac::SelectNextTab() {
|
|||
[window_ selectNextTab:nil];
|
||||
}
|
||||
|
||||
void NativeWindowMac::ShowAllTabs() {
|
||||
[window_ toggleTabOverview:nil];
|
||||
}
|
||||
|
||||
void NativeWindowMac::MergeAllWindows() {
|
||||
[window_ mergeAllWindows:nil];
|
||||
}
|
||||
|
|
|
@ -65,6 +65,7 @@ Role kRolesMap[] = {
|
|||
{@selector(toggleFullScreenMode:), "togglefullscreen"},
|
||||
{@selector(toggleTabBar:), "toggletabbar"},
|
||||
{@selector(selectNextTab:), "selectnexttab"},
|
||||
{@selector(toggleTabOverview:), "showalltabs"},
|
||||
{@selector(selectPreviousTab:), "selectprevioustab"},
|
||||
{@selector(mergeAllWindows:), "mergeallwindows"},
|
||||
{@selector(moveTabToNewWindow:), "movetabtonewwindow"},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue