diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2023-04-14 15:24:54 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2023-05-26 11:29:55 +0000 |
commit | ab965b1c2c3e7e4cd62a4b45abfaf393f4fb4618 (patch) | |
tree | 906ba4a71162c3ebcae0b742dbe01076af2abb22 /chromium/chrome/browser/ui/webui/explore_sites_internals | |
parent | 813d9ae984a99e739b99cf694a9d5b24d0a6b7a7 (diff) |
BASELINE: Update Chromium to 112.0.5615.132
Change-Id: I59e23789618066826010171a36efbf8a68965ed0
Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/472282
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/chrome/browser/ui/webui/explore_sites_internals')
7 files changed, 0 insertions, 271 deletions
diff --git a/chromium/chrome/browser/ui/webui/explore_sites_internals/BUILD.gn b/chromium/chrome/browser/ui/webui/explore_sites_internals/BUILD.gn deleted file mode 100644 index e4fb93b6297..00000000000 --- a/chromium/chrome/browser/ui/webui/explore_sites_internals/BUILD.gn +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright 2018 The Chromium Authors -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//mojo/public/tools/bindings/mojom.gni") - -mojom("mojo_bindings") { - sources = [ "explore_sites_internals.mojom" ] - webui_module_path = "/" -} diff --git a/chromium/chrome/browser/ui/webui/explore_sites_internals/OWNERS b/chromium/chrome/browser/ui/webui/explore_sites_internals/OWNERS deleted file mode 100644 index 97834375988..00000000000 --- a/chromium/chrome/browser/ui/webui/explore_sites_internals/OWNERS +++ /dev/null @@ -1,4 +0,0 @@ -file://chrome/browser/android/explore_sites/OWNERS - -per-file *.mojom=set noparent -per-file *.mojom=file://ipc/SECURITY_OWNERS diff --git a/chromium/chrome/browser/ui/webui/explore_sites_internals/explore_sites_internals.mojom b/chromium/chrome/browser/ui/webui/explore_sites_internals/explore_sites_internals.mojom deleted file mode 100644 index 9b975668863..00000000000 --- a/chromium/chrome/browser/ui/webui/explore_sites_internals/explore_sites_internals.mojom +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2018 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -module explore_sites_internals.mojom; - -// Browser interface for the page. Consists of calls for data and hooks for -// interactivity. -interface PageHandler { - // Get a key/value mapping of properties. - GetProperties() => (map<string, string> properties); - - // Clear the cached suggestions. - ClearCachedExploreSitesCatalog() => (bool success); - - // Force the fetcher to ping the server for a new catalog. - ForceNetworkRequest() => (bool success); - - // Force the fetcher to use a different country code than that provided by - // Finch. - OverrideCountryCode(string country_code) => (bool success); -}; diff --git a/chromium/chrome/browser/ui/webui/explore_sites_internals/explore_sites_internals_page_handler.cc b/chromium/chrome/browser/ui/webui/explore_sites_internals/explore_sites_internals_page_handler.cc deleted file mode 100644 index 1cd3356d330..00000000000 --- a/chromium/chrome/browser/ui/webui/explore_sites_internals/explore_sites_internals_page_handler.cc +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2018 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -#include "chrome/browser/ui/webui/explore_sites_internals/explore_sites_internals_page_handler.h" - -#include <string> -#include <utility> -#include <vector> - -#include "base/containers/flat_map.h" -#include "chrome/browser/android/explore_sites/explore_sites_feature.h" -#include "chrome/browser/android/explore_sites/url_util.h" -#include "chrome/browser/flags/android/chrome_feature_list.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/explore_sites_internals/explore_sites_internals.mojom.h" -#include "components/language/core/browser/pref_names.h" -#include "components/prefs/pref_service.h" -#include "mojo/public/cpp/bindings/pending_receiver.h" -#include "mojo/public/cpp/bindings/receiver.h" - -namespace explore_sites { -using chrome::android::explore_sites::ExploreSitesVariation; -using chrome::android::explore_sites::GetExploreSitesVariation; - -namespace { - -std::string GetChromeFlagsSetupString() { - switch (GetExploreSitesVariation()) { - case ExploreSitesVariation::ENABLED: - return "Enabled"; - case ExploreSitesVariation::DISABLED: - return "Disabled"; - } -} -} // namespace - -ExploreSitesInternalsPageHandler::ExploreSitesInternalsPageHandler( - mojo::PendingReceiver<explore_sites_internals::mojom::PageHandler> receiver, - ExploreSitesService* explore_sites_service, - Profile* profile) - : receiver_(this, std::move(receiver)), - explore_sites_service_(explore_sites_service), - profile_(profile) {} - -ExploreSitesInternalsPageHandler::~ExploreSitesInternalsPageHandler() {} - -void ExploreSitesInternalsPageHandler::GetProperties( - GetPropertiesCallback callback) { - base::flat_map<std::string, std::string> properties; - properties["chrome-flags-setup"] = GetChromeFlagsSetupString(); - properties["server-endpoint"] = GetCatalogURL().spec(); - properties["country-code"] = explore_sites_service_->GetCountryCode(); - std::move(callback).Run(properties); -} - -void ExploreSitesInternalsPageHandler::ClearCachedExploreSitesCatalog( - ClearCachedExploreSitesCatalogCallback callback) { - if (ExploreSitesVariation::DISABLED == GetExploreSitesVariation()) { - std::move(callback).Run(false); - return; - } - - explore_sites_service_->ClearCachedCatalogsForDebugging(); - std::move(callback).Run(true); -} - -void ExploreSitesInternalsPageHandler::ForceNetworkRequest( - ForceNetworkRequestCallback callback) { - explore_sites_service_->UpdateCatalogFromNetwork( - true /* is_immediate_fetch */, - profile_->GetPrefs()->GetString(language::prefs::kAcceptLanguages), - std::move(callback)); -} - -void ExploreSitesInternalsPageHandler::OverrideCountryCode( - const std::string& country_code, - OverrideCountryCodeCallback callback) { - if (ExploreSitesVariation::DISABLED == GetExploreSitesVariation()) { - std::move(callback).Run(false); - return; - } - - explore_sites_service_->OverrideCountryCodeForDebugging(country_code); - std::move(callback).Run(true); -} - -} // namespace explore_sites diff --git a/chromium/chrome/browser/ui/webui/explore_sites_internals/explore_sites_internals_page_handler.h b/chromium/chrome/browser/ui/webui/explore_sites_internals/explore_sites_internals_page_handler.h deleted file mode 100644 index c473c4079d1..00000000000 --- a/chromium/chrome/browser/ui/webui/explore_sites_internals/explore_sites_internals_page_handler.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2018 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_UI_WEBUI_EXPLORE_SITES_INTERNALS_EXPLORE_SITES_INTERNALS_PAGE_HANDLER_H_ -#define CHROME_BROWSER_UI_WEBUI_EXPLORE_SITES_INTERNALS_EXPLORE_SITES_INTERNALS_PAGE_HANDLER_H_ - -#include "base/memory/raw_ptr.h" -#include "chrome/browser/android/explore_sites/explore_sites_service.h" -#include "chrome/browser/ui/webui/explore_sites_internals/explore_sites_internals.mojom.h" -#include "mojo/public/cpp/bindings/pending_receiver.h" -#include "mojo/public/cpp/bindings/receiver.h" - -class Profile; - -namespace explore_sites { - -// Concrete implementation of explore_sites_internals::mojom::PageHandler. -class ExploreSitesInternalsPageHandler - : public explore_sites_internals::mojom::PageHandler { - public: - ExploreSitesInternalsPageHandler( - mojo::PendingReceiver<explore_sites_internals::mojom::PageHandler> - receiver, - ExploreSitesService* explore_sites_service, - Profile* profile); - - ExploreSitesInternalsPageHandler(const ExploreSitesInternalsPageHandler&) = - delete; - ExploreSitesInternalsPageHandler& operator=( - const ExploreSitesInternalsPageHandler&) = delete; - - ~ExploreSitesInternalsPageHandler() override; - - private: - // explore_sites_internals::mojom::ExploreSitesInternalsPageHandler - void GetProperties(GetPropertiesCallback) override; - void ClearCachedExploreSitesCatalog( - ClearCachedExploreSitesCatalogCallback) override; - void OverrideCountryCode(const std::string& country_code, - OverrideCountryCodeCallback) override; - void ForceNetworkRequest(ForceNetworkRequestCallback) override; - - mojo::Receiver<explore_sites_internals::mojom::PageHandler> receiver_; - raw_ptr<ExploreSitesService> explore_sites_service_; - raw_ptr<Profile> profile_; -}; - -} // namespace explore_sites - -#endif // CHROME_BROWSER_UI_WEBUI_EXPLORE_SITES_INTERNALS_EXPLORE_SITES_INTERNALS_PAGE_HANDLER_H_ diff --git a/chromium/chrome/browser/ui/webui/explore_sites_internals/explore_sites_internals_ui.cc b/chromium/chrome/browser/ui/webui/explore_sites_internals/explore_sites_internals_ui.cc deleted file mode 100644 index b5f0200d639..00000000000 --- a/chromium/chrome/browser/ui/webui/explore_sites_internals/explore_sites_internals_ui.cc +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2018 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ui/webui/explore_sites_internals/explore_sites_internals_ui.h" - -#include "base/bind.h" -#include "build/build_config.h" -#include "chrome/browser/android/explore_sites/explore_sites_service_factory.h" -#include "chrome/browser/flags/android/chrome_feature_list.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/browser/ui/webui/explore_sites_internals/explore_sites_internals.mojom.h" -#include "chrome/browser/ui/webui/explore_sites_internals/explore_sites_internals_page_handler.h" -#include "chrome/common/url_constants.h" -#include "chrome/grit/browser_resources.h" -#include "content/public/browser/web_ui_data_source.h" -#include "mojo/public/cpp/bindings/pending_receiver.h" - -namespace explore_sites { - -ExploreSitesInternalsUI::ExploreSitesInternalsUI(content::WebUI* web_ui) - : ui::MojoWebUIController(web_ui) { - content::WebUIDataSource* source = content::WebUIDataSource::Create( - chrome::kChromeUIExploreSitesInternalsHost); - - source->AddResourcePath("explore_sites_internals.css", - IDR_EXPLORE_SITES_INTERNALS_CSS); - source->AddResourcePath("explore_sites_internals.js", - IDR_EXPLORE_SITES_INTERNALS_JS); - source->AddResourcePath("explore_sites_internals.mojom-webui.js", - IDR_EXPLORE_SITES_INTERNALS_MOJO_JS); - source->SetDefaultResource(IDR_EXPLORE_SITES_INTERNALS_HTML); - - Profile* profile = Profile::FromWebUI(web_ui); - explore_sites_service_ = - ExploreSitesServiceFactory::GetForBrowserContext(profile); - content::WebUIDataSource::Add(profile, source); -} - -WEB_UI_CONTROLLER_TYPE_IMPL(ExploreSitesInternalsUI) - -ExploreSitesInternalsUI::~ExploreSitesInternalsUI() {} - -void ExploreSitesInternalsUI::BindInterface( - mojo::PendingReceiver<explore_sites_internals::mojom::PageHandler> - receiver) { - page_handler_ = std::make_unique<ExploreSitesInternalsPageHandler>( - std::move(receiver), explore_sites_service_, - Profile::FromWebUI(web_ui())); -} - -} // namespace explore_sites diff --git a/chromium/chrome/browser/ui/webui/explore_sites_internals/explore_sites_internals_ui.h b/chromium/chrome/browser/ui/webui/explore_sites_internals/explore_sites_internals_ui.h deleted file mode 100644 index 0ad6c6cdc7e..00000000000 --- a/chromium/chrome/browser/ui/webui/explore_sites_internals/explore_sites_internals_ui.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2018 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_UI_WEBUI_EXPLORE_SITES_INTERNALS_EXPLORE_SITES_INTERNALS_UI_H_ -#define CHROME_BROWSER_UI_WEBUI_EXPLORE_SITES_INTERNALS_EXPLORE_SITES_INTERNALS_UI_H_ - -#include <memory> - -#include "base/memory/raw_ptr.h" -#include "chrome/browser/ui/webui/explore_sites_internals/explore_sites_internals.mojom-forward.h" -#include "chrome/browser/ui/webui/explore_sites_internals/explore_sites_internals_page_handler.h" -#include "mojo/public/cpp/bindings/pending_receiver.h" -#include "ui/webui/mojo_web_ui_controller.h" - -namespace explore_sites { - -// UI controller for chrome://explore-sites-internals, hooks up a concrete -// implementation of explore_sites_internals::mojom::PageHandler to requests for -// that page handler that will come from the frontend. -class ExploreSitesInternalsUI : public ui::MojoWebUIController { - public: - explicit ExploreSitesInternalsUI(content::WebUI* web_ui); - - ExploreSitesInternalsUI(const ExploreSitesInternalsUI&) = delete; - ExploreSitesInternalsUI& operator=(const ExploreSitesInternalsUI&) = delete; - - ~ExploreSitesInternalsUI() override; - - // Instantiates the implementor of the mojom::PageHandler mojo - // interface passing the pending receiver that will be internally bound. - void BindInterface( - mojo::PendingReceiver<explore_sites_internals::mojom::PageHandler> - receiver); - - private: - std::unique_ptr<ExploreSitesInternalsPageHandler> page_handler_; - raw_ptr<ExploreSitesService> explore_sites_service_; - - WEB_UI_CONTROLLER_TYPE_DECL(); -}; - -} // namespace explore_sites - -#endif // CHROME_BROWSER_UI_WEBUI_EXPLORE_SITES_INTERNALS_EXPLORE_SITES_INTERNALS_UI_H_ |