diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-07-16 11:45:35 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-07-17 08:59:23 +0000 |
commit | 552906b0f222c5d5dd11b9fd73829d510980461a (patch) | |
tree | 3a11e6ed0538a81dd83b20cf3a4783e297f26d91 /chromium/chrome/browser/extensions/api/tabs/tabs_api.cc | |
parent | 1b05827804eaf047779b597718c03e7d38344261 (diff) | |
download | qtwebengine-chromium-552906b0f222c5d5dd11b9fd73829d510980461a.tar.gz |
BASELINE: Update Chromium to 83.0.4103.122
Change-Id: Ie3a82f5bb0076eec2a7c6a6162326b4301ee291e
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/chrome/browser/extensions/api/tabs/tabs_api.cc')
-rw-r--r-- | chromium/chrome/browser/extensions/api/tabs/tabs_api.cc | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/chromium/chrome/browser/extensions/api/tabs/tabs_api.cc b/chromium/chrome/browser/extensions/api/tabs/tabs_api.cc index e520e8ac977..44268dd99c3 100644 --- a/chromium/chrome/browser/extensions/api/tabs/tabs_api.cc +++ b/chromium/chrome/browser/extensions/api/tabs/tabs_api.cc @@ -41,7 +41,6 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/resource_coordinator/tab_lifecycle_unit_external.h" #include "chrome/browser/resource_coordinator/tab_manager.h" -#include "chrome/browser/sessions/session_tab_helper.h" #include "chrome/browser/translate/chrome_translate_client.h" #include "chrome/browser/ui/apps/chrome_app_delegate.h" #include "chrome/browser/ui/browser.h" @@ -63,6 +62,7 @@ #include "chrome/common/url_constants.h" #include "components/pref_registry/pref_registry_syncable.h" #include "components/prefs/pref_service.h" +#include "components/sessions/content/session_tab_helper.h" #include "components/translate/core/browser/language_state.h" #include "components/translate/core/common/language_detection_details.h" #include "components/zoom/zoom_controller.h" @@ -485,6 +485,9 @@ ExtensionFunction::ResponseAction WindowsCreateFunction::Run() { if (ExtensionTabUtil::IsKillURL(url)) return RespondNow(Error(tabs_constants::kNoCrashBrowserError)); urls.push_back(url); + + // Log if this navigation looks like it is to a devtools URL. + ExtensionTabUtil::LogPossibleDevtoolsSchemeNavigation(url); } } @@ -547,9 +550,8 @@ ExtensionFunction::ResponseAction WindowsCreateFunction::Run() { // Initialize default window bounds according to window type. ui::WindowShowState ignored_show_state = ui::SHOW_STATE_DEFAULT; - WindowSizer::GetBrowserWindowBoundsAndShowState(std::string(), gfx::Rect(), - nullptr, &window_bounds, - &ignored_show_state); + WindowSizer::GetBrowserWindowBoundsAndShowState( + gfx::Rect(), nullptr, &window_bounds, &ignored_show_state); // Any part of the bounds can optionally be set by the caller. if (create_data->left) @@ -877,7 +879,6 @@ ExtensionFunction::ResponseAction TabsQueryFunction::Run() { EXTENSION_FUNCTION_VALIDATE(params.get()); bool loading_status_set = params->query_info.status != tabs::TAB_STATUS_NONE; - bool loading = params->query_info.status == tabs::TAB_STATUS_LOADING; URLPatternSet url_patterns; if (params->query_info.url.get()) { @@ -1034,8 +1035,11 @@ ExtensionFunction::ResponseAction TabsQueryFunction::Run() { } } - if (loading_status_set && loading != web_contents->IsLoading()) + if (loading_status_set && + params->query_info.status != + ExtensionTabUtil::GetLoadingStatus(web_contents)) { continue; + } result->Append(CreateTabObjectHelper(web_contents, extension(), source_context_type(), tab_strip, i) @@ -1225,7 +1229,7 @@ ExtensionFunction::ResponseAction TabsUpdateFunction::Run() { contents = browser->tab_strip_model()->GetActiveWebContents(); if (!contents) return RespondNow(Error(tabs_constants::kNoSelectedTabError)); - tab_id = SessionTabHelper::IdForTab(contents).id(); + tab_id = sessions::SessionTabHelper::IdForTab(contents).id(); } else { tab_id = *params->tab_id; } @@ -1347,6 +1351,9 @@ bool TabsUpdateFunction::UpdateURL(const std::string& url_string, return false; } + // Log if this navigation looks like it is to a devtools URL. + ExtensionTabUtil::LogPossibleDevtoolsSchemeNavigation(url); + const bool is_javascript_scheme = url.SchemeIs(url::kJavaScriptScheme); UMA_HISTOGRAM_BOOLEAN("Extensions.ApiTabUpdateJavascript", is_javascript_scheme); @@ -1672,7 +1679,7 @@ WebContents* TabsCaptureVisibleTabFunction::GetWebContentsForID( if (!extension()->permissions_data()->CanCaptureVisiblePage( contents->GetLastCommittedURL(), - SessionTabHelper::IdForTab(contents).id(), error, + sessions::SessionTabHelper::IdForTab(contents).id(), error, extensions::CaptureRequirement::kActiveTabOrAllUrls)) { return nullptr; } |