Alexey Baskakov | 2f8bf816 | 2018-07-17 01:06:11 | [diff] [blame] | 1 | // Copyright 2018 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 | |
Song Fangzhen | 49468b2 | 2021-09-02 15:41:59 | [diff] [blame] | 5 | #ifndef CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_HELPERS_H_ |
| 6 | #define CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_HELPERS_H_ |
Alexey Baskakov | 2f8bf816 | 2018-07-17 01:06:11 | [diff] [blame] | 7 | |
| 8 | #include <string> |
| 9 | |
Song Fangzhen | cda4af6 | 2021-09-09 05:24:02 | [diff] [blame^] | 10 | #include "chrome/browser/web_applications/web_app_id.h" |
Anton Bikineev | 46bbb97 | 2021-05-15 17:53:53 | [diff] [blame] | 11 | #include "third_party/abseil-cpp/absl/types/optional.h" |
Alan Cutter | e511d18a | 2021-08-04 23:10:38 | [diff] [blame] | 12 | #include "third_party/blink/public/mojom/manifest/manifest.mojom-forward.h" |
Glen Robertson | 271d133 | 2020-01-28 00:16:02 | [diff] [blame] | 13 | |
Alexey Baskakov | 2f8bf816 | 2018-07-17 01:06:11 | [diff] [blame] | 14 | class GURL; |
Eric Willigers | f5089bf | 2020-02-17 21:37:58 | [diff] [blame] | 15 | class Profile; |
Alexey Baskakov | 2f8bf816 | 2018-07-17 01:06:11 | [diff] [blame] | 16 | |
| 17 | namespace web_app { |
| 18 | |
| 19 | // Compute a deterministic name based on the URL. We use this pseudo name |
| 20 | // as a key to store window location per application URLs in Browser and |
| 21 | // as app id for BrowserWindow, shortcut and jump list. |
| 22 | std::string GenerateApplicationNameFromURL(const GURL& url); |
| 23 | |
Alexey Baskakov | f302efe | 2018-07-28 02:02:32 | [diff] [blame] | 24 | // Compute a deterministic name based on an apps's id. |
Alexey Baskakov | c9025c8 | 2018-10-09 04:33:58 | [diff] [blame] | 25 | std::string GenerateApplicationNameFromAppId(const AppId& app_id); |
Alexey Baskakov | f302efe | 2018-07-28 02:02:32 | [diff] [blame] | 26 | |
| 27 | // Extracts the application id from the app name. |
Alexey Baskakov | c9025c8 | 2018-10-09 04:33:58 | [diff] [blame] |
|