Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Side by Side Diff: chrome/browser/webshare/share_target_pref_helper.h

Issue 2679523002: Store target app name in Web Share prefs, and add extra logic. (Closed)
Patch Set: My nits Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_WEBSHARE_SHARE_TARGET_PREF_HELPER_H_ 5 #ifndef CHROME_BROWSER_WEBSHARE_SHARE_TARGET_PREF_HELPER_H_
6 #define CHROME_BROWSER_WEBSHARE_SHARE_TARGET_PREF_HELPER_H_ 6 #define CHROME_BROWSER_WEBSHARE_SHARE_TARGET_PREF_HELPER_H_
7 7
8 #include "base/optional.h" 8 #include "base/optional.h"
9 #include "base/strings/string_piece.h" 9 #include "base/strings/string_piece.h"
10 #include "content/public/common/manifest.h"
10 11
12 class GURL;
11 class PrefService; 13 class PrefService;
12 14
13 // Adds the Web Share target |share_target_origin| with template |url_template| 15 // Adds the Web Share target defined by |manifest_url| to |pref_service| under
14 // to |pref_service| under kWebShareVisitedTargets. If |url_template| is null, 16 // kWebShareVisitedTargets. It maps the key |manifest_url| to a dictionary that
15 // this function will remove |share_target_origin| from kWebShareVisitedTargets, 17 // contains a dictionary of the attributes of the share_target field, as well as
16 // if it is there. 18 // the name field in |manifest|. If the |manifest| doesn't contain a
17 void UpdateShareTargetInPrefs(base::StringPiece manifest_url, 19 // share_target field, or it does but there is no url_template field, this will
18 base::Optional<std::string> url_template, 20 // remove |manifest_url| from kWebShareVisitedTargets, if it is there.
19 PrefService* pref_service); 21 void UpdateShareTargetInPrefs(const GURL& manifest_url,
22 const content::Manifest& manifest,
23 PrefService* pref_service);
20 24
21 #endif // CHROME_BROWSER_WEBSHARE_SHARE_TARGET_PREF_HELPER_H_ 25 #endif // CHROME_BROWSER_WEBSHARE_SHARE_TARGET_PREF_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698