mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
feat: add tabbingIdentifier property to BrowserWindow (#40410)
feat: add tabbingIdentifier property to BrowserWindow
This commit is contained in:
@@ -945,6 +945,14 @@ void BaseWindow::AddTabbedWindow(NativeWindow* window,
|
||||
args->ThrowError("AddTabbedWindow cannot be called by a window on itself.");
|
||||
}
|
||||
|
||||
v8::Local<v8::Value> BaseWindow::GetTabbingIdentifier() {
|
||||
auto tabbing_id = window_->GetTabbingIdentifier();
|
||||
if (!tabbing_id.has_value())
|
||||
return v8::Undefined(isolate());
|
||||
|
||||
return gin::ConvertToV8(isolate(), tabbing_id.value());
|
||||
}
|
||||
|
||||
void BaseWindow::SetAutoHideMenuBar(bool auto_hide) {
|
||||
window_->SetAutoHideMenuBar(auto_hide);
|
||||
}
|
||||
@@ -1296,6 +1304,7 @@ void BaseWindow::BuildPrototype(v8::Isolate* isolate,
|
||||
.SetMethod("moveTabToNewWindow", &BaseWindow::MoveTabToNewWindow)
|
||||
.SetMethod("toggleTabBar", &BaseWindow::ToggleTabBar)
|
||||
.SetMethod("addTabbedWindow", &BaseWindow::AddTabbedWindow)
|
||||
.SetProperty("tabbingIdentifier", &BaseWindow::GetTabbingIdentifier)
|
||||
.SetMethod("setWindowButtonVisibility",
|
||||
&BaseWindow::SetWindowButtonVisibility)
|
||||
.SetMethod("_getWindowButtonVisibility",
|
||||
|
||||
@@ -198,9 +198,7 @@ class BaseWindow : public gin_helper::TrackableObject<BaseWindow>,
|
||||
bool GetWindowButtonVisibility() const;
|
||||
void SetWindowButtonPosition(absl::optional<gfx::Point> position);
|
||||
absl::optional<gfx::Point> GetWindowButtonPosition() const;
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
bool IsHiddenInMissionControl();
|
||||
void SetHiddenInMissionControl(bool hidden);
|
||||
#endif
|
||||
@@ -214,6 +212,7 @@ class BaseWindow : public gin_helper::TrackableObject<BaseWindow>,
|
||||
void MoveTabToNewWindow();
|
||||
void ToggleTabBar();
|
||||
void AddTabbedWindow(NativeWindow* window, gin_helper::Arguments* args);
|
||||
v8::Local<v8::Value> GetTabbingIdentifier();
|
||||
void SetAutoHideMenuBar(bool auto_hide);
|
||||
bool IsMenuBarAutoHide();
|
||||
void SetMenuBarVisibility(bool visible);
|
||||
|
||||
Reference in New Issue
Block a user