blob: 113cd04c4d9129683196e4424a5012c71c73e0b6 [file] [log] [blame]
Alan Cuttereb525cd02020-06-20 03:12:421// Copyright 2020 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_WEB_APP_PROTO_UTILS_H_
6#define CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_PROTO_UTILS_H_
7
8#include <vector>
9
Carlos Frias514cf672020-08-13 23:53:4310#include "chrome/browser/web_applications/proto/web_app.pb.h"
Alan Cuttereb525cd02020-06-20 03:12:4211#include "chrome/browser/web_applications/web_app.h"
12#include "components/sync/protocol/web_app_specifics.pb.h"
Anton Bikineev46bbb972021-05-15 17:53:5313#include "third_party/abseil-cpp/absl/types/optional.h"
Alan Cuttereb525cd02020-06-20 03:12:4214
Evan Stadefbe5ca52021-08-19 00:51:4315namespace apps {
16struct IconInfo;
17}
18
Alan Cuttereb525cd02020-06-20 03:12:4219namespace web_app {
20
Carlos Frias514cf672020-08-13 23:53:4321enum class RunOnOsLoginMode;
22
Alan Cuttereb525cd02020-06-20 03:12:4223using RepeatedIconInfosProto =
24 const ::google::protobuf::RepeatedPtrField<::sync_pb::WebAppIconInfo>;
25
Evan Stadefbe5ca52021-08-19 00:51:4326absl::optional<std::vector<apps::IconInfo>> ParseAppIconInfos(
27 const char* container_name_for_logging,
Eric Willigers197ff882022-03-02 07:15:4528 const RepeatedIconInfosProto& manifest_icons_proto);
Evan Stadefbe5ca52021-08-19 00:51:4329
Glen Robertson2c6387b2020-07-10 06:31:5930// Use the given |app| to populate a |WebAppSpecifics| sync proto.
31sync_pb::WebAppSpecifics WebAppToSyncProto(const WebApp& app);
32
Glen Robertson2585e8a92020-07-29 08:33:0833// Use the given |icon_info| to populate a |WebAppIconInfo| sync proto.
Evan Stade