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
   61
   62
   63
   64
   65

ash / components / arc / test / fake_notifications_instance.h [blame]

// Copyright 2016 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_COMPONENTS_ARC_TEST_FAKE_NOTIFICATIONS_INSTANCE_H_
#define ASH_COMPONENTS_ARC_TEST_FAKE_NOTIFICATIONS_INSTANCE_H_

#include <string>
#include <utility>
#include <vector>

#include "ash/components/arc/mojom/notifications.mojom.h"
#include "mojo/public/cpp/bindings/pending_remote.h"

namespace arc {

class FakeNotificationsInstance : public mojom::NotificationsInstance {
 public:
  FakeNotificationsInstance();

  FakeNotificationsInstance(const FakeNotificationsInstance&) = delete;
  FakeNotificationsInstance& operator=(const FakeNotificationsInstance&) =
      delete;

  ~FakeNotificationsInstance() override;

  // mojom::NotificationsInstance overrides:
  void Init(mojo::PendingRemote<mojom::NotificationsHost> host_remote,
            InitCallback callback) override;

  void SendNotificationEventToAndroid(
      const std::string& key,
      mojom::ArcNotificationEvent event) override;
  void SendNotificationButtonClickToAndroid(const std::string& key,
                                            uint32_t button_index,
                                            const std::string& input) override;
  void CreateNotificationWindow(const std::string& key) override;
  void CloseNotificationWindow(const std::string& key) override;
  void OpenNotificationSettings(const std::string& key) override;
  void PopUpAppNotificationSettings(const std::string& key) override;
  void OpenNotificationSnoozeSettings(const std::string& key) override;
  void SetDoNotDisturbStatusOnAndroid(
      mojom::ArcDoNotDisturbStatusPtr status) override;
  void CancelPress(const std::string& key) override;
  void PerformDeferredUserAction(uint32_t action_id) override;
  void CancelDeferredUserAction(uint32_t action_id) override;
  void SetLockScreenSettingOnAndroid(
      mojom::ArcLockScreenNotificationSettingPtr setting) override;
  void SetNotificationConfiguration(
      mojom::NotificationConfigurationPtr configuration) override;
  void OnMessageCenterVisibilityChanged(
      mojom::MessageCenterVisibility visibility) override;

  const std::vector<std::pair<std::string, mojom::ArcNotificationEvent>>&
  events() const;
  const mojom::ArcDoNotDisturbStatusPtr& latest_do_not_disturb_status() const;

 private:
  std::vector<std::pair<std::string, mojom::ArcNotificationEvent>> events_;
  mojom::ArcDoNotDisturbStatusPtr latest_do_not_disturb_status_;
};

}  // namespace arc

#endif  // ASH_COMPONENTS_ARC_TEST_FAKE_NOTIFICATIONS_INSTANCE_H_