angular/devtools/projects/shell-browser/src/app/app.config.ts
hawkgs cb8d30a293 refactor(devtools): save user settings in the settings store (#62429)
Save user settings in the `SettingsStore`.

NOTE: The theme is omitted since the change is not trivial and it will be handled in a separate PR.

PR Close #62429
2025-08-06 15:12:00 +02:00

44 lines
1.5 KiB
TypeScript

/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {ApplicationConfig, provideZonelessChangeDetection} from '@angular/core';
import {ApplicationEnvironment, ApplicationOperations, provideSettings} from '../../../ng-devtools';
import {ChromeApplicationEnvironment} from './chrome-application-environment';
import {ChromeApplicationOperations} from './chrome-application-operations';
import {Events, MessageBus, PriorityAwareMessageBus} from '../../../protocol';
import {FrameManager} from '../../../ng-devtools/src/lib/application-services/frame_manager';
import {Platform} from '@angular/cdk/platform';
import {ChromeMessageBus} from './chrome-message-bus';
export const appConfig: ApplicationConfig = {
providers: [
provideZonelessChangeDetection(),
{provide: FrameManager, useFactory: () => FrameManager.initialize()},
{
provide: ApplicationOperations,
useClass: ChromeApplicationOperations,
deps: [Platform],
},
{
provide: ApplicationEnvironment,
useClass: ChromeApplicationEnvironment,
},
{
provide: MessageBus,
useFactory(): MessageBus<Events> {
const port = chrome.runtime.connect({
name: '' + chrome.devtools.inspectedWindow.tabId,
});
return new PriorityAwareMessageBus(new ChromeMessageBus(port));
},
},
provideSettings(),
],
};