fix(extensions): add more properties to port.sender.tab (#22592)
* fix: add more properties to port.sender.tab * fix: apply the suggestion Co-Authored-By: Jeremy Apthorp <nornagon@nornagon.net> Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
This commit is contained in:
parent
34e004015d
commit
7150fa783e
1 changed files with 8 additions and 2 deletions
|
@ -20,11 +20,10 @@
|
||||||
#include "extensions/browser/pref_names.h"
|
#include "extensions/browser/pref_names.h"
|
||||||
#include "extensions/common/api/messaging/port_id.h"
|
#include "extensions/common/api/messaging/port_id.h"
|
||||||
#include "extensions/common/extension.h"
|
#include "extensions/common/extension.h"
|
||||||
|
#include "shell/browser/api/electron_api_web_contents.h"
|
||||||
#include "ui/gfx/native_widget_types.h"
|
#include "ui/gfx/native_widget_types.h"
|
||||||
#include "url/gurl.h"
|
#include "url/gurl.h"
|
||||||
|
|
||||||
#include "shell/browser/api/electron_api_web_contents.h"
|
|
||||||
|
|
||||||
namespace extensions {
|
namespace extensions {
|
||||||
|
|
||||||
ElectronMessagingDelegate::ElectronMessagingDelegate() = default;
|
ElectronMessagingDelegate::ElectronMessagingDelegate() = default;
|
||||||
|
@ -48,6 +47,13 @@ ElectronMessagingDelegate::MaybeGetTabInfo(content::WebContents* web_contents) {
|
||||||
auto tab = std::make_unique<base::DictionaryValue>();
|
auto tab = std::make_unique<base::DictionaryValue>();
|
||||||
tab->SetWithoutPathExpansion(
|
tab->SetWithoutPathExpansion(
|
||||||
"id", std::make_unique<base::Value>(api_contents->ID()));
|
"id", std::make_unique<base::Value>(api_contents->ID()));
|
||||||
|
tab->SetWithoutPathExpansion(
|
||||||
|
"url", std::make_unique<base::Value>(api_contents->GetURL().spec()));
|
||||||
|
tab->SetWithoutPathExpansion(
|
||||||
|
"title", std::make_unique<base::Value>(api_contents->GetTitle()));
|
||||||
|
tab->SetWithoutPathExpansion(
|
||||||
|
"audible",
|
||||||
|
std::make_unique<base::Value>(api_contents->IsCurrentlyAudible()));
|
||||||
return tab;
|
return tab;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue