blob: 407bdeb128f8ae1e30147b7423d20dd1d7e896c0 [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/optional.h"
#include "base/strings/string_piece.h"
#include "third_party/blink/public/common/manifest/manifest.h"
class GURL;
class PrefService;
// Adds the Web Share target defined by |manifest_url| to |pref_service| under
// kWebShareVisitedTargets. It maps the key |manifest_url| to a dictionary that
// contains a dictionary of the attributes of the share_target field, as well as
// the name field in |manifest|. If the |manifest| doesn't contain a
// share_target field, or it does but there is no url_template field, this will
// remove |manifest_url| from kWebShareVisitedTargets, if it is there.
void UpdateShareTargetInPrefs(const GURL& manifest_url,
const blink::Manifest& manifest,
PrefService* pref_service);