1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46

ash / public / cpp / tab_strip_delegate.h [blame]

// 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.

#ifndef ASH_PUBLIC_CPP_TAB_STRIP_DELEGATE_H_
#define ASH_PUBLIC_CPP_TAB_STRIP_DELEGATE_H_

#include <string>
#include <vector>

#include "ash/public/cpp/ash_public_export.h"
#include "base/functional/callback.h"
#include "base/time/time.h"
#include "ui/base/models/image_model.h"
#include "url/gurl.h"

namespace aura {
class Window;
}

namespace ash {

// Basic tab info.
struct ASH_PUBLIC_EXPORT TabInfo {
  TabInfo();
  TabInfo(const TabInfo& other);
  ~TabInfo();
  std::u16string title;
  GURL url;
  ui::ImageModel favicon;
  base::TimeTicks last_access_timetick;
};

// This delegate is owned by Shell and used by //ash/webui/boca_ui to fetch
// opened tabs in browser windows.
class ASH_PUBLIC_EXPORT TabStripDelegate {
 public:
  virtual ~TabStripDelegate() = default;

  // Gathers the tab list information for the window.
  virtual std::vector<TabInfo> GetTabsListForWindow(
      aura::Window* window) const = 0;
};

}  // namespace ash
#endif  // ASH_PUBLIC_CPP_TAB_STRIP_DELEGATE_H_