2021-06-16 21:54:26 +02:00
|
|
|
// Copyright 2021 The Chromium Embedded Framework Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be found
|
|
|
|
// in the LICENSE file.
|
|
|
|
|
|
|
|
#include "libcef/browser/extensions/alloy_extensions_util.h"
|
|
|
|
|
|
|
|
#include "libcef/browser/alloy/alloy_browser_host_impl.h"
|
|
|
|
|
|
|
|
namespace extensions {
|
|
|
|
namespace alloy {
|
|
|
|
|
|
|
|
int GetTabIdForWebContents(content::WebContents* web_contents) {
|
|
|
|
auto browser = AlloyBrowserHostImpl::GetBrowserForContents(web_contents);
|
2023-01-02 23:59:03 +01:00
|
|
|
if (!browser) {
|
2021-06-16 21:54:26 +02:00
|
|
|
return -1;
|
2023-01-02 23:59:03 +01:00
|
|
|
}
|
2021-06-16 21:54:26 +02:00
|
|
|
return browser->GetIdentifier();
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace alloy
|
|
|
|
} // namespace extensions
|