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/consumer_instance_info.h

Issue 906493004: Refactoring: de-couple Extensions from "script injection System" [render side]:2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@decouple_brower_isolated_world_1
Patch Set: Rebase. Created 5 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 side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698