mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
feat: add support for chrome.tabs.query (#39431)
* feat: add support for tabs.query Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * fix: scope to webContents in current session Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * test: add test for session behavior Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
@@ -4443,6 +4443,16 @@ WebContents* WebContents::FromID(int32_t id) {
|
||||
return GetAllWebContents().Lookup(id);
|
||||
}
|
||||
|
||||
// static
|
||||
std::list<WebContents*> WebContents::GetWebContentsList() {
|
||||
std::list<WebContents*> list;
|
||||
for (auto iter = base::IDMap<WebContents*>::iterator(&GetAllWebContents());
|
||||
!iter.IsAtEnd(); iter.Advance()) {
|
||||
list.push_back(iter.GetCurrentValue());
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
// static
|
||||
gin::WrapperInfo WebContents::kWrapperInfo = {gin::kEmbedderNativeGin};
|
||||
|
||||
|
||||
@@ -137,6 +137,7 @@ class WebContents : public ExclusiveAccessContext,
|
||||
// if there is no associated wrapper.
|
||||
static WebContents* From(content::WebContents* web_contents);
|
||||
static WebContents* FromID(int32_t id);
|
||||
static std::list<WebContents*> GetWebContentsList();
|
||||
|
||||
// Get the V8 wrapper of the |web_contents|, or create one if not existed.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user