blob: 2f478854709e5e6769d33be2c14101ef68f3175c [file] [log] [blame]
Alexey Baskakov2f8bf8162018-07-17 01:06:111// 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 Fangzhen49468b22021-09-02 15:41:595#ifndef CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_HELPERS_H_
6#define CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_HELPERS_H_
Alexey Baskakov2f8bf8162018-07-17 01:06:117
8#include <string>
9
Song Fangzhencda4af62021-09-09 05:24:0210#include "chrome/browser/web_applications/web_app_id.h"
Anton Bikineev46bbb972021-05-15 17:53:5311#include "third_party/abseil-cpp/absl/types/optional.h"
Alan Cuttere511d18a2021-08-04 23:10:3812#include "third_party/blink/public/mojom/manifest/manifest.mojom-forward.h"
Glen Robertson271d1332020-01-28 00:16:0213
Alexey Baskakov2f8bf8162018-07-17 01:06:1114class GURL;
Eric Willigersf5089bf2020-02-17 21:37:5815class Profile;
Alexey Baskakov2f8bf8162018-07-17 01:06:1116
17namespace 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.
22std::string GenerateApplicationNameFromURL(const GURL& url);
23
Alexey Baskakovf302efe2018-07-28 02:02:3224// Compute a deterministic name based on an apps's id.
Alexey Baskakovc9025c82018-10-09 04:33:5825std::string GenerateApplicationNameFromAppId(const AppId& app_id);
Alexey Baskakovf302efe2018-07-28 02:02:3226
27// Extracts the application id from the app name.
Alexey Baskakovc9025c82018-10-09 04:33:58