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
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60

ash / webui / files_internals / files_internals_page_handler.h [blame]

// Copyright 2022 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_FILES_INTERNALS_FILES_INTERNALS_PAGE_HANDLER_H_
#define ASH_WEBUI_FILES_INTERNALS_FILES_INTERNALS_PAGE_HANDLER_H_

#include "ash/webui/files_internals/mojom/files_internals.mojom.h"
#include "base/memory/raw_ptr.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/receiver.h"

namespace ash {

class FilesInternalsUI;

// Implements the mojom::files_internals::PageHandler interface.
class FilesInternalsPageHandler : public mojom::files_internals::PageHandler {
 public:
  FilesInternalsPageHandler(
      FilesInternalsUI* files_internals_ui,
      mojo::PendingReceiver<mojom::files_internals::PageHandler> receiver);
  FilesInternalsPageHandler(const FilesInternalsPageHandler&) = delete;
  FilesInternalsPageHandler& operator=(const FilesInternalsPageHandler&) =
      delete;
  ~FilesInternalsPageHandler() override;

  // mojom::files_internals::PageHandler overrides.
  void GetSmbfsEnableVerboseLogging(
      GetSmbfsEnableVerboseLoggingCallback callback) override;
  void SetSmbfsEnableVerboseLogging(bool enabled) override;
  void GetOfficeFileHandlers(GetOfficeFileHandlersCallback callback) override;
  void ClearOfficeFileHandlers() override;
  void GetMoveConfirmationShownForDrive(
      GetMoveConfirmationShownForDriveCallback callback) override;
  void GetMoveConfirmationShownForOneDrive(
      GetMoveConfirmationShownForOneDriveCallback callback) override;
  void GetMoveConfirmationShownForLocalToDrive(
      GetMoveConfirmationShownForLocalToDriveCallback callback) override;
  void GetMoveConfirmationShownForLocalToOneDrive(
      GetMoveConfirmationShownForLocalToOneDriveCallback callback) override;
  void GetMoveConfirmationShownForCloudToDrive(
      GetMoveConfirmationShownForCloudToDriveCallback callback) override;
  void GetMoveConfirmationShownForCloudToOneDrive(
      GetMoveConfirmationShownForCloudToOneDriveCallback callback) override;
  void GetAlwaysMoveOfficeFilesToDrive(
      GetAlwaysMoveOfficeFilesToDriveCallback callback) override;
  void SetAlwaysMoveOfficeFilesToDrive(bool always_move) override;
  void GetAlwaysMoveOfficeFilesToOneDrive(
      GetAlwaysMoveOfficeFilesToOneDriveCallback callback) override;
  void SetAlwaysMoveOfficeFilesToOneDrive(bool always_move) override;

 private:
  raw_ptr<FilesInternalsUI> files_internals_ui_;  // Owns |this|.
  mojo::Receiver<mojom::files_internals::PageHandler> receiver_;
};

}  // namespace ash

#endif  // ASH_WEBUI_FILES_INTERNALS_FILES_INTERNALS_PAGE_HANDLER_H_