Luciano Pacheco | 4d0d7a5 | 2021-10-25 03:59:26 | [diff] [blame] | 1 | // Copyright 2021 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | import {AllowedPaths} from './allowed_paths.js'; |
| 6 | import {DialogType} from './dialog_type.js'; |
| 7 | |
| 8 | |
| 9 | // TODO(b/199452030): Fix duplication with files_app_state.js |
| 10 | /** |
| 11 | * FilesAppState is used in 2 ways: |
| 12 | * |
| 13 | * 1. Persist in the localStorage the some state, like current directory, |
| 14 | * sorting column options, etc. |
| 15 | * |
| 16 | * 2. To open a new window: |
| 17 | * 2.1, Requests to open a new window set part of these options to configure the |
| 18 | * how the new window should behave. |
| 19 | * 2.2 When the Files app extension is restarted, the background page retrieves |
| 20 | * the last state from localStorage for each opened window and re-spawn the |
| 21 | * windows with their state. |
| 22 | * |
| 23 | * @record |
| 24 | */ |
| 25 | export class FilesAppState { |
| 26 | constructor() { |
| 27 | /** |
| 28 | * The desired target directory when opening a new window. |
| 29 | * @public {string|null|undefined} |
| 30 | */ |
| 31 | this.currentDirectoryURL; |
| 32 | |
| 33 | /** |
|
|