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 | |
| 5 | #ifndef CHROME_BROWSER_WEB_APPLICATIONS_COMPONENTS_WEB_APP_HELPERS_H_ |
| 6 | #define CHROME_BROWSER_WEB_APPLICATIONS_COMPONENTS_WEB_APP_HELPERS_H_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | class GURL; |
| 11 | |
| 12 | namespace web_app { |
| 13 | |
| 14 | // Compute a deterministic name based on the URL. We use this pseudo name |
| 15 | // as a key to store window location per application URLs in Browser and |
| 16 | // as app id for BrowserWindow, shortcut and jump list. |
| 17 | std::string GenerateApplicationNameFromURL(const GURL& url); |
| 18 | |
Alexey Baskakov | f302efe | 2018-07-28 02:02:32 | [diff] [blame^] | 19 | // Compute a deterministic name based on an apps's id. |
| 20 | std::string GenerateApplicationNameFromAppId(const std::string& app_id); |
| 21 | |
| 22 | // Extracts the application id from the app name. |
| 23 | std::string GetAppIdFromApplicationName(const std::string& app_name); |
| 24 | |
Alexey Baskakov | 2f8bf816 | 2018-07-17 01:06:11 | [diff] [blame] | 25 | } // namespace web_app |
| 26 | |
| 27 | #endif // CHROME_BROWSER_WEB_APPLICATIONS_COMPONENTS_WEB_APP_HELPERS_H_ |