| 1 | package main |
| 2 | |
| 3 | import "sync/atomic" |
| 4 | |
| 5 | // browserControl is the shell-owned capability switch for the built-in browser. |
| 6 | // The shell persists it; this process only mirrors the value the shell pushes so |
| 7 | // session construction reads one source. |
| 8 | type browserControl struct { |
| 9 | disabled atomic.Bool |
| 10 | } |
| 11 | |
| 12 | func (b *browserControl) setEnabled(enabled bool) { b.disabled.Store(!enabled) } |
| 13 | |
| 14 | func (b *browserControl) off() bool { return b.disabled.Load() } |
| 15 | |
| 16 | // setBrowserControlEnabled records whether new sessions may drive the built-in |
| 17 | // browser. The shell owns the value and pushes it over desktop/browserControl, |
| 18 | // so this stays off the renderer-facing contract. |
| 19 | func (a *App) setBrowserControlEnabled(enabled bool) { |
| 20 | a.browserControl.setEnabled(enabled) |
| 21 | } |
| 22 |