De-dup PrefixSet code in SafeBrowsingDatabaseManager.
[chromium-blink-merge.git] / components / proximity_auth / connection_observer.h
blob89bf9741c7056e62f0a0ff9f9ab42d70b8a85b11
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_PROXIMITY_AUTH_CONNECTION_OBSERVER_H
6 #define COMPONENTS_PROXIMITY_AUTH_CONNECTION_OBSERVER_H
8 #include "components/proximity_auth/connection.h"
10 namespace proximity_auth {
12 class WireMessage;
14 // An interface for observing events that happen on a Connection.
15 class ConnectionObserver {
16 public:
17 // Called when the |connection|'s status changes from |old_status| to
18 // |new_status|.
19 virtual void OnConnectionStatusChanged(const Connection& connection,
20 Connection::Status old_status,
21 Connection::Status new_status) {}
23 // Called when a |message| is received from a remote device over the
24 // |connection|.
25 virtual void OnMessageReceived(const Connection& connection,
26 const WireMessage& message) {}
28 // Called after a |message| is sent to the remote device over the
29 // |connection|. |success| is |true| iff the message is sent successfully.
30 virtual void OnSendCompleted(const Connection& connection,
31 const WireMessage& message,
32 bool success) {}
35 } // namespace proximity_auth
37 #endif // COMPONENTS_PROXIMITY_AUTH_CONNECTION_OBSERVER_H