Index: extensions/common/consumer_instance_info.h |
diff --git a/extensions/common/consumer_instance_info.h b/extensions/common/consumer_instance_info.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b4cf466b6d6035bac8737e7b033b1a348c6b5231 |
--- /dev/null |
+++ b/extensions/common/consumer_instance_info.h |
@@ -0,0 +1,33 @@ |
+// Copyright 2015 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_CONSUMER_INSTANCE_INFO_H_ |
+#define EXTENSIONS_COMMON_CONSUMER_INSTANCE_INFO_H_ |
+ |
+#include <string> |
+ |
+// Info of API consumer instance that content scripts will be injected on. |
+struct ConsumerInstanceInfo { |
+ enum InstanceType { TAB, WEBVIEW }; |
+ |
+ ConsumerInstanceInfo() {} |
+ ConsumerInstanceInfo(InstanceType type, int id) |
+ : type_(type), |
+ id_(id) { |
+ } |
+ |
+ InstanceType type() const { return type_; } |
+ int id() const { return id_; } |
+ |
+ private: |
+ // The type of the consumer instance. |
+ InstanceType type_; |
+ |
+ // The id of the consumer instance. |
+ // If the instance is a regular tab, |id_| is 0. |
+ // If the instance is a <webview>, |id_| > 0. |
+ int id_; |
+}; |
+ |
+#endif // EXTENSIONS_COMMON_CONSUMER_INSTANCE_INFO_H_ |