OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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 #ifndef EXTENSIONS_COMMON_CONSUMER_INSTANCE_INFO_H_ |
| 6 #define EXTENSIONS_COMMON_CONSUMER_INSTANCE_INFO_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 // Info of API consumer instance that content scripts will be injected on. |
| 11 struct ConsumerInstanceInfo { |
| 12 enum InstanceType { TAB, WEBVIEW }; |
| 13 |
| 14 ConsumerInstanceInfo() {} |
| 15 ConsumerInstanceInfo(InstanceType type, int id) |
| 16 : type_(type), |
| 17 id_(id) { |
| 18 } |
| 19 |
| 20 InstanceType type() const { return type_; } |
| 21 int id() const { return id_; } |
| 22 |
| 23 private: |
| 24 // The type of the consumer instance. |
| 25 InstanceType type_; |
| 26 |
| 27 // The id of the consumer instance. |
| 28 // If the instance is a regular tab, |id_| is 0. |
| 29 // If the instance is a <webview>, |id_| > 0. |
| 30 int id_; |
| 31 }; |
| 32 |
| 33 #endif // EXTENSIONS_COMMON_CONSUMER_INSTANCE_INFO_H_ |
OLD | NEW |