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

Side by Side Diff: chrome/common/extensions/chrome_aliases.cc

Issue 2379763003: Extract permission alias info from PermissionsProvider (Closed)
Patch Set: Introduce extension::AliasProvider Created 4 years, 2 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
(Empty)
1 // Copyright 2016 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 #include "chrome/common/extensions/chrome_aliases.h"
6
7 #include "base/macros.h"
Devlin 2016/10/07 18:36:21 needed?
tbarzic 2016/10/07 20:41:17 yes, for arraysize.
8
9 namespace extensions {
10
11 namespace {
12
13 struct AliasInfo {
14 const char* const alias_name;
15 const char* const real_name;
16 };
17
18 const AliasInfo kPermissionAliases[] = {
19 {"windows", "tabs"},
20 };
21
22 } // namespace
23
24 std::vector<Alias> GetChromePermissionAliases() {
25 std::vector<Alias> result;
Devlin 2016/10/07 18:36:21 Why not return { Alias("windows", "tabs"), }; ?
tbarzic 2016/10/07 20:41:17 Main reason: it's clearer which string is alias na
Devlin 2016/10/07 21:05:59 But it's only clearer because you basically re-def
26 for (size_t i = 0; i < arraysize(kPermissionAliases); ++i) {
27 const AliasInfo& kAlias = kPermissionAliases[i];
28 result.push_back(Alias(kAlias.alias_name, kAlias.real_name));
29 }
30 return result;
31 }
32
33 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698