summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/extensions/api/tabs
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/chrome/browser/extensions/api/tabs
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/chrome/browser/extensions/api/tabs')
-rw-r--r--chromium/chrome/browser/extensions/api/tabs/tabs_api.cc23
-rw-r--r--chromium/chrome/browser/extensions/api/tabs/tabs_event_router.cc4
-rw-r--r--chromium/chrome/browser/extensions/api/tabs/windows_event_router.cc10
3 files changed, 13 insertions, 24 deletions
diff --git a/chromium/chrome/browser/extensions/api/tabs/tabs_api.cc b/chromium/chrome/browser/extensions/api/tabs/tabs_api.cc
index f4d183ab977..38c40a7e868 100644
--- a/chromium/chrome/browser/extensions/api/tabs/tabs_api.cc
+++ b/chromium/chrome/browser/extensions/api/tabs/tabs_api.cc
@@ -919,7 +919,7 @@ ExtensionFunction::ResponseAction TabsQueryFunction::Run() {
Browser* current_browser =
ChromeExtensionFunctionDetails(this).GetCurrentBrowser();
for (auto* browser : *BrowserList::GetInstance()) {
- if (!profile->IsSameProfile(browser->profile()))
+ if (!profile->IsSameOrParent(browser->profile()))
continue;
if (!browser->window())
@@ -1211,8 +1211,7 @@ bool TabsHighlightFunction::HighlightTab(TabStripModel* tabstrip,
return true;
}
-TabsUpdateFunction::TabsUpdateFunction() : web_contents_(NULL) {
-}
+TabsUpdateFunction::TabsUpdateFunction() : web_contents_(nullptr) {}
ExtensionFunction::ResponseAction TabsUpdateFunction::Run() {
std::unique_ptr<tabs::Update::Params> params(
@@ -1580,20 +1579,10 @@ ExtensionFunction::ResponseAction TabsReloadFunction::Run() {
}
}
- if (web_contents->ShowingInterstitialPage()) {
- // This does as same as Browser::ReloadInternal.
- NavigationEntry* entry = web_contents->GetController().GetVisibleEntry();
- GURL reload_url = entry ? entry->GetURL() : GURL(url::kAboutBlankURL);
- OpenURLParams params(reload_url, Referrer(),
- WindowOpenDisposition::CURRENT_TAB,
- ui::PAGE_TRANSITION_RELOAD, false);
- current_browser->OpenURL(params);
- } else {
- web_contents->GetController().Reload(
- bypass_cache ? content::ReloadType::BYPASSING_CACHE
- : content::ReloadType::NORMAL,
- true);
- }
+ web_contents->GetController().Reload(
+ bypass_cache ? content::ReloadType::BYPASSING_CACHE
+ : content::ReloadType::NORMAL,
+ true);
return RespondNow(NoArguments());
}
diff --git a/chromium/chrome/browser/extensions/api/tabs/tabs_event_router.cc b/chromium/chrome/browser/extensions/api/tabs/tabs_event_router.cc
index fd2ff75a3af..517e299ae20 100644
--- a/chromium/chrome/browser/extensions/api/tabs/tabs_event_router.cc
+++ b/chromium/chrome/browser/extensions/api/tabs/tabs_event_router.cc
@@ -177,7 +177,7 @@ TabsEventRouter::~TabsEventRouter() {
}
bool TabsEventRouter::ShouldTrackBrowser(Browser* browser) {
- return profile_->IsSameProfile(browser->profile()) &&
+ return profile_->IsSameOrParent(browser->profile()) &&
ExtensionTabUtil::BrowserSupportsTabs(browser);
}
@@ -571,7 +571,7 @@ void TabsEventRouter::DispatchEvent(
std::unique_ptr<base::ListValue> args,
EventRouter::UserGestureState user_gesture) {
EventRouter* event_router = EventRouter::Get(profile);
- if (!profile_->IsSameProfile(profile) || !event_router)
+ if (!profile_->IsSameOrParent(profile) || !event_router)
return;
auto event = std::make_unique<Event>(histogram_value, event_name,
diff --git a/chromium/chrome/browser/extensions/api/tabs/windows_event_router.cc b/chromium/chrome/browser/extensions/api/tabs/windows_event_router.cc
index 5f41fa24c34..05b785e9ac0 100644
--- a/chromium/chrome/browser/extensions/api/tabs/windows_event_router.cc
+++ b/chromium/chrome/browser/extensions/api/tabs/windows_event_router.cc
@@ -180,14 +180,14 @@ WindowsEventRouter::~WindowsEventRouter() {
}
void WindowsEventRouter::OnAppWindowAdded(extensions::AppWindow* app_window) {
- if (!profile_->IsSameProfile(
+ if (!profile_->IsSameOrParent(
Profile::FromBrowserContext(app_window->browser_context())))
return;
AddAppWindow(app_window);
}
void WindowsEventRouter::OnAppWindowRemoved(extensions::AppWindow* app_window) {
- if (!profile_->IsSameProfile(
+ if (!profile_->IsSameOrParent(
Profile::FromBrowserContext(app_window->browser_context())))
return;
@@ -206,7 +206,7 @@ void WindowsEventRouter::OnWindowControllerAdded(
WindowController* window_controller) {
if (!HasEventListener(windows::OnCreated::kEventName))
return;
- if (!profile_->IsSameProfile(window_controller->profile()))
+ if (!profile_->IsSameOrParent(window_controller->profile()))
return;
// Ignore any windows without an associated browser (e.g., AppWindows).
if (!window_controller->GetBrowser())
@@ -228,7 +228,7 @@ void WindowsEventRouter::OnWindowControllerRemoved(
WindowController* window_controller) {
if (!HasEventListener(windows::OnRemoved::kEventName))
return;
- if (!profile_->IsSameProfile(window_controller->profile()))
+ if (!profile_->IsSameOrParent(window_controller->profile()))
return;
// Ignore any windows without an associated browser (e.g., AppWindows).
if (!window_controller->GetBrowser())
@@ -263,7 +263,7 @@ void WindowsEventRouter::OnActiveWindowChanged(
Profile* window_profile = nullptr;
int window_id = extension_misc::kUnknownWindowId;
if (window_controller &&
- profile_->IsSameProfile(window_controller->profile())) {
+ profile_->IsSameOrParent(window_controller->profile())) {
window_profile = window_controller->profile();
window_id = window_controller->GetWindowId();
}