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 / assistant / model / assistant_notification_model_observer.h [blame]
// Copyright 2018 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_ASSISTANT_MODEL_ASSISTANT_NOTIFICATION_MODEL_OBSERVER_H_
#define ASH_ASSISTANT_MODEL_ASSISTANT_NOTIFICATION_MODEL_OBSERVER_H_
#include "base/component_export.h"
#include "base/observer_list_types.h"
namespace ash {
namespace assistant {
struct AssistantNotification;
}
// A checked observer which receives notification of changes to the Assistant
// notification model.
class COMPONENT_EXPORT(ASSISTANT_MODEL) AssistantNotificationModelObserver
: public base::CheckedObserver {
public:
using AssistantNotification = assistant::AssistantNotification;
// Invoked when the specified |notification| has been added.
virtual void OnNotificationAdded(const AssistantNotification& notification) {}
// Invoked when the specified |notification| has been updated.
virtual void OnNotificationUpdated(
const AssistantNotification& notification) {}
// Invoked when the specified |notification| has been removed. If
// |from_server| is true the request to remove was initiated by the server.
virtual void OnNotificationRemoved(const AssistantNotification& notification,
bool from_server) {}
// Invoked when all notifications have been removed. If |from_server| is true
// the request to remove was initiated by the server.
virtual void OnAllNotificationsRemoved(bool from_server) {}
protected:
~AssistantNotificationModelObserver() override = default;
};
} // namespace ash
#endif // ASH_ASSISTANT_MODEL_ASSISTANT_NOTIFICATION_MODEL_OBSERVER_H_