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

ash / webui / focus_mode / focus_mode_ui.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_WEBUI_FOCUS_MODE_FOCUS_MODE_UI_H_
#define ASH_WEBUI_FOCUS_MODE_FOCUS_MODE_UI_H_

#include <memory>

#include "ash/webui/focus_mode/mojom/focus_mode.mojom.h"
#include "content/public/browser/webui_config.h"
#include "ui/webui/mojo_web_ui_controller.h"

namespace ash {

class FocusModeTrackProvider;

// The WebUI for chrome://focus-mode-media.
class FocusModeUI : public ui::MojoWebUIController {
 public:
  explicit FocusModeUI(content::WebUI* web_ui);
  ~FocusModeUI() override;

  void BindInterface(
      mojo::PendingReceiver<focus_mode::mojom::TrackProvider> receiver);

 private:
  std::unique_ptr<FocusModeTrackProvider> track_provider_;

  WEB_UI_CONTROLLER_TYPE_DECL();
};

// The WebUIConfig for chrome://focus-mode-media.
class FocusModeUIConfig : public content::DefaultWebUIConfig<FocusModeUI> {
 public:
  FocusModeUIConfig();

  // content::DefaultWebUIConfig:
  bool IsWebUIEnabled(content::BrowserContext* browser_context) override;
};

}  // namespace ash

#endif  // ASH_WEBUI_FOCUS_MODE_FOCUS_MODE_UI_H_