chromium/chrome/browser/ui/webui/top_chrome/per_profile_webui_tracker.cc

// Copyright 2024 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/top_chrome/per_profile_webui_tracker.h"

#include <map>
#include <memory>
#include <set>

#include "base/memory/raw_ptr.h"
#include "base/observer_list.h"
#include "chrome/browser/profiles/profile.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
#include "url/gurl.h"

namespace {

// The impl class that implements PerProfileWebUITracker.
// PerProfileWebUITracker is an abstract class so that it can be easily mocked
// in tests.
class PerProfileWebUITrackerImpl : public PerProfileWebUITracker {};

// We need an observer instance for each WebContents because methods in
// WebContentsObserver does not provide a pointer to the WebContents itself. If
// we observe WebContents in the tracker class we will be unable to distinguish
// the source WebContents.
class PerProfileWebUITrackerImpl::WebContentsObserver
    : public content::WebContentsObserver {};

void PerProfileWebUITrackerImpl::AddWebContents(
    content::WebContents* web_contents) {}

bool PerProfileWebUITrackerImpl::ProfileHasWebUI(Profile* profile,
                                                 std::string webui_url) const {}

void PerProfileWebUITrackerImpl::AddObserver(Observer* observer) {}

void PerProfileWebUITrackerImpl::RemoveObserver(Observer* observer) {}

void PerProfileWebUITrackerImpl::OnWebContentsDestroyed(
    content::WebContents* web_contents) {}

void PerProfileWebUITrackerImpl::OnWebContentsOriginChanged(
    content::WebContents* web_contents,
    url::Origin old_origin,
    url::Origin new_origin) {}

void PerProfileWebUITrackerImpl::OnWebContentsPrimaryPageChanged(
    content::WebContents* web_contents) {}

}  // namespace

// static
std::unique_ptr<PerProfileWebUITracker> PerProfileWebUITracker::Create() {}