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

Unified Diff: extensions/common/api_alias_info.h

Issue 2379763003: Extract permission alias info from PermissionsProvider (Closed)
Patch Set: not nesting Alias in AliasProvider Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: extensions/common/api_alias_info.h
diff --git a/extensions/common/api_alias_info.h b/extensions/common/api_alias_info.h
new file mode 100644
index 0000000000000000000000000000000000000000..286ca8f91522a32e27d939be9324d760b019adf8
--- /dev/null
+++ b/extensions/common/api_alias_info.h
@@ -0,0 +1,43 @@
+// Copyright 2016 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.
+
+#ifndef EXTENSIONS_COMMON_API_ALIAS_INFO_H_
+#define EXTENSIONS_COMMON_API_ALIAS_INFO_H_
+
+#include <vector>
+
+#include "base/lazy_instance.h"
+#include "base/macros.h"
+
+namespace extensions {
+
+class Alias;
+class AliasProvider;
+
+// Global instance containing information about existing API aliases.
+class ApiAliasInfo {
Devlin 2016/09/29 22:03:43 Similarly here, it doesn't look like we use this c
tbarzic 2016/09/29 22:27:13 I'm working on adding code using this fairly soon
Devlin 2016/09/29 22:30:41 Then let's add it in that CL :) It's difficult to
tbarzic 2016/09/29 22:57:31 OK, my plan was to reduce the size of that CL, but
+ public:
+ static ApiAliasInfo* GetInstance();
+
+ // Adds a provider from which additional API aliases are retrieved.
+ // Should be used to initialize |this| - before |api_aliases()| is used.
+ void AddProvider(const AliasProvider& provider);
+
+ const std::vector<Alias>& api_aliases() const { return api_aliases_; }
+
+ private:
+ friend struct base::DefaultLazyInstanceTraits<ApiAliasInfo>;
+
+ ApiAliasInfo();
+ virtual ~ApiAliasInfo();
+
+ // List of known API aliases.
+ std::vector<Alias> api_aliases_;
+
+ DISALLOW_COPY_AND_ASSIGN(ApiAliasInfo);
+};
+
+} // namespace extensions
+
+#endif // EXTENSIONS_COMMON_API_ALIAS_INFO_H_

Powered by Google App Engine
This is Rietveld 408576698