chromium/chrome/browser/ui/webui/browser_switch/browser_switch_ui.cc

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "chrome/browser/ui/webui/browser_switch/browser_switch_ui.h"

#include <memory>
#include <string_view>

#include "base/functional/bind.h"
#include "base/metrics/histogram_macros.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/time.h"
#include "base/values.h"
#include "chrome/browser/browser_switcher/alternative_browser_driver.h"
#include "chrome/browser/browser_switcher/browser_switcher_service.h"
#include "chrome/browser/browser_switcher/browser_switcher_service_factory.h"
#include "chrome/browser/browser_switcher/browser_switcher_sitelist.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/webui/webui_util.h"
#include "chrome/common/webui_url_constants.h"
#include "chrome/grit/branded_strings.h"
#include "chrome/grit/browser_switch_resources.h"
#include "chrome/grit/browser_switch_resources_map.h"
#include "chrome/grit/generated_resources.h"
#include "components/grit/components_resources.h"
#include "content/public/browser/page_navigator.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
#include "content/public/browser/web_ui_message_handler.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/page_transition_types.h"
#include "url/gurl.h"

namespace {

void GotoNewTabPage(content::WebContents* web_contents) {}

// Returns true if there's only 1 tab left open in this profile. Incognito
// window tabs count as the same profile.
bool IsLastTab(const Profile* profile) {}

// Returns a dictionary like:
//
// {
//   "sitelist": ["example.com", ...],
//   "greylist": ["example.net", ...]
// }
base::Value::Dict RuleSetToDict(const browser_switcher::RuleSet& ruleset) {}

browser_switcher::BrowserSwitcherService* GetBrowserSwitcherService(
    content::WebUI* web_ui) {}

void CreateAndAddBrowserSwitchUIHTMLSource(content::WebUI* web_ui) {}

}  // namespace

class BrowserSwitchHandler : public content::WebUIMessageHandler {};

BrowserSwitchHandler::BrowserSwitchHandler() {}

BrowserSwitchHandler::~BrowserSwitchHandler() = default;

void BrowserSwitchHandler::RegisterMessages() {}

void BrowserSwitchHandler::OnJavascriptAllowed() {}

void BrowserSwitchHandler::OnJavascriptDisallowed() {}

void BrowserSwitchHandler::OnAllRulesetsParsed(
    browser_switcher::BrowserSwitcherService* service) {}

void BrowserSwitchHandler::OnBrowserSwitcherPrefsChanged(
    browser_switcher::BrowserSwitcherPrefs* prefs,
    const std::vector<std::string>& changed_prefs) {}

void BrowserSwitchHandler::SendDataChangedEvent() {}

void BrowserSwitchHandler::HandleLaunchAlternativeBrowserAndCloseTab(
    const base::Value::List& args) {}

void BrowserSwitchHandler::OnLaunchFinished(base::TimeTicks start,
                                            std::string callback_id,
                                            bool success) {}

void BrowserSwitchHandler::HandleGotoNewTabPage(const base::Value::List& args) {}

void BrowserSwitchHandler::HandleGetAllRulesets(const base::Value::List& args) {}

void BrowserSwitchHandler::HandleGetDecision(const base::Value::List& args) {}

void BrowserSwitchHandler::HandleGetTimestamps(const base::Value::List& args) {}

void BrowserSwitchHandler::HandleGetRulesetSources(
    const base::Value::List& args) {}

void BrowserSwitchHandler::HandleRefreshXml(const base::Value::List& args) {}

void BrowserSwitchHandler::HandleIsBrowserSwitchEnabled(
    const base::Value::List& args) {}

BrowserSwitchUI::BrowserSwitchUI(content::WebUI* web_ui)
    :{}