Skip to content

Commit

Permalink
[PM-5134] Make Default Setting for Overlay "On Focus" (#7297)
Browse files Browse the repository at this point in the history
  • Loading branch information
cagonzalezcs authored Dec 22, 2023
1 parent deba1a9 commit 690f4a0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/browser/src/background/main.background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,7 @@ export default class MainBackground {
this.logService,
this.configService,
this.fido2Service,
this.settingsService,
);
this.nativeMessagingBackground = new NativeMessagingBackground(
this.cryptoService,
Expand Down
6 changes: 6 additions & 0 deletions apps/browser/src/background/runtime.background.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { NotificationsService } from "@bitwarden/common/abstractions/notifications.service";
import { SettingsService } from "@bitwarden/common/abstractions/settings.service";
import { ConfigServiceAbstraction } from "@bitwarden/common/platform/abstractions/config/config.service.abstraction";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
Expand All @@ -14,6 +15,7 @@ import {
} from "../auth/popup/utils/auth-popout-window";
import LockedVaultPendingNotificationsItem from "../autofill/notification/models/locked-vault-pending-notifications-item";
import { AutofillService } from "../autofill/services/abstractions/autofill.service";
import { AutofillOverlayVisibility } from "../autofill/utils/autofill-overlay.enum";
import { BrowserApi } from "../platform/browser/browser-api";
import { BrowserStateService } from "../platform/services/abstractions/browser-state.service";
import { BrowserEnvironmentService } from "../platform/services/browser-environment.service";
Expand Down Expand Up @@ -43,6 +45,7 @@ export default class RuntimeBackground {
private logService: LogService,
private configService: ConfigServiceAbstraction,
private fido2Service: Fido2Service,
private settingsService: SettingsService,
) {
// onInstalled listener must be wired up before anything else, so we do it in the ctor
chrome.runtime.onInstalled.addListener((details: any) => {
Expand Down Expand Up @@ -325,6 +328,9 @@ export default class RuntimeBackground {
if (this.onInstalledReason != null) {
if (this.onInstalledReason === "install") {
BrowserApi.createNewTab("https://bitwarden.com/browser-start/");
await this.settingsService.setAutoFillOverlayVisibility(
AutofillOverlayVisibility.OnFieldFocus,
);

if (await this.environmentService.hasManagedEnvironment()) {
await this.environmentService.setUrlsToManagedEnvironment();
Expand Down

0 comments on commit 690f4a0

Please sign in to comment.