chromium/chrome/browser/ui/browser_finder.cc

// Copyright 2012 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/browser_finder.h"

#include <stdint.h>

#include "base/containers/contains.h"
#include "base/ranges/algorithm.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/tab_contents/tab_contents_iterator.h"
#include "chrome/browser/ui/tabs/tab_group_model.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "components/tab_groups/tab_group_id.h"
#include "content/public/browser/navigation_controller.h"
#include "ui/base/interaction/element_identifier.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"

#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ash/public/cpp/multi_user_window_manager.h"
#include "chrome/browser/ui/ash/multi_user/multi_user_util.h"
#include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_helper.h"
#include "components/account_id/account_id.h"
#endif

WebContents;

namespace {

bool IsBrowserClosing(Browser* browser) {}

// Type used to indicate to match anything. This does not include browsers
// scheduled for deletion (see `kIncludeBrowsersScheduledForDeletion`).
const uint32_t kMatchAny =;

// See BrowserMatches for details.
const uint32_t kMatchOriginalProfile =;
const uint32_t kMatchCanSupportWindowFeature =;
const uint32_t kMatchNormal =;
const uint32_t kMatchDisplayId =;
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS)
const uint32_t kMatchCurrentWorkspace = 1 << 4;
#endif
const uint32_t kMatchNotClosing =;
// If set, a Browser marked for deletion will be returned. Generally
// code using these functions does not want a browser scheduled for deletion,
// but there are outliers.
const uint32_t kIncludeBrowsersScheduledForDeletion =;

bool DoesBrowserMatchProfile(Browser& browser,
                             Profile* profile,
                             uint32_t match_types) {}

// Returns true if the specified |browser| matches the specified arguments.
// |match_types| is a bitmask dictating what parameters to match:
// . If kMatchAnyProfile is true, the profile is not considered.
// . If it contains kMatchOriginalProfile then the original profile of the
//   browser must match |profile->GetOriginalProfile()|. This is used to match
//   incognito windows.
// . If it contains kMatchCanSupportWindowFeature
//   |CanSupportWindowFeature(window_feature)| must return true.
// . If it contains kMatchNormal, the browser must be a normal tabbed browser.
// . If it contains kMatchNotClosing, the browser must not be a closing browser.
bool BrowserMatches(Browser* browser,
                    Profile* profile,
                    Browser::WindowFeature window_feature,
                    uint32_t match_types,
                    int64_t display_id) {}

// Returns the first browser in the specified iterator that returns true from
// |BrowserMatches|, or null if no browsers match the arguments. See
// |BrowserMatches| for details on the arguments.
template <class T>
Browser* FindBrowserMatching(const T& begin,
                             const T& end,
                             Profile* profile,
                             Browser::WindowFeature window_feature,
                             uint32_t match_types,
                             int64_t display_id = display::kInvalidDisplayId) {}

Browser* FindBrowserWithTabbedOrAnyType(
    Profile* profile,
    bool match_tabbed,
    bool match_original_profiles,
    bool match_current_workspace,
    bool match_not_closing,
    int64_t display_id = display::kInvalidDisplayId) {}

size_t GetBrowserCountImpl(Profile* profile,
                           uint32_t match_types,
                           int64_t display_id = display::kInvalidDisplayId) {}

}  // namespace

namespace chrome {

Browser* FindTabbedBrowser(Profile* profile,
                           bool match_original_profiles,
                           int64_t display_id,
                           bool ignore_closing_browsers) {}

Browser* FindAnyBrowser(Profile* profile, bool match_original_profiles) {}

Browser* FindBrowserWithProfile(Profile* profile) {}

std::vector<Browser*> FindAllTabbedBrowsersWithProfile(Profile* profile) {}

std::vector<Browser*> FindAllBrowsersWithProfile(Profile* profile) {}

Browser* FindBrowserWithID(SessionID desired_id) {}

Browser* FindBrowserWithWindow(gfx::NativeWindow window) {}

Browser* FindBrowserWithActiveWindow() {}

Browser* FindBrowserWithTab(const WebContents* web_contents) {}

Browser* FindBrowserWithGroup(tab_groups::TabGroupId group, Profile* profile) {}

Browser* FindBrowserWithUiElementContext(ui::ElementContext context) {}

Browser* FindLastActiveWithProfile(Profile* profile) {}

Browser* FindLastActive() {}

size_t GetTotalBrowserCount() {}

size_t GetBrowserCount(Profile* profile) {}

size_t GetTabbedBrowserCount(Profile* profile) {}

}  // namespace chrome