| Index: chrome/browser/extensions/api/tabs/tabs_api.cc
|
| diff --git a/chrome/browser/extensions/api/tabs/tabs_api.cc b/chrome/browser/extensions/api/tabs/tabs_api.cc
|
| index c43670ac9311cae7af1a10fa403731139a561a98..cbced11e5836c0bdddf8486a2ddc677eaf9f2c19 100644
|
| --- a/chrome/browser/extensions/api/tabs/tabs_api.cc
|
| +++ b/chrome/browser/extensions/api/tabs/tabs_api.cc
|
| @@ -993,10 +993,15 @@ bool TabsQueryFunction::RunSync() {
|
| continue;
|
| }
|
|
|
| - // If tab_manager isn't present, then no tabs are discarded.
|
| - bool discarded = tab_manager && tab_manager->IsTabDiscarded(web_contents);
|
| - if (!MatchesBool(params->query_info.discarded.get(), discarded))
|
| + if (!MatchesBool(params->query_info.discarded.get(),
|
| + tab_manager->IsTabDiscarded(web_contents))) {
|
| continue;
|
| + }
|
| +
|
| + if (!MatchesBool(params->query_info.auto_discardable.get(),
|
| + tab_manager->IsTabAutoDiscardable(web_contents))) {
|
| + continue;
|
| + }
|
|
|
| if (!MatchesBool(params->query_info.muted.get(),
|
| web_contents->IsAudioMuted())) {
|
| @@ -1336,6 +1341,12 @@ bool TabsUpdateFunction::RunAsync() {
|
| tab_strip->SetOpenerOfWebContentsAt(tab_index, opener_contents);
|
| }
|
|
|
| + if (params->update_properties.auto_discardable.get()) {
|
| + bool state = *params->update_properties.auto_discardable;
|
| + g_browser_process->GetTabManager()->SetTabAutoDiscardableState(contents,
|
| + state);
|
| + }
|
| +
|
| if (!is_async) {
|
| PopulateResult();
|
| SendResponse(true);
|
|
|