ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / content / public / browser / presentation_service_delegate.h
blob2929c47c5d9f5e4869ba1b1e1713453ad8fdd2b7
1 // Copyright 2015 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 CONTENT_PUBLIC_BROWSER_PRESENTATION_SERVICE_DELEGATE_H_
6 #define CONTENT_PUBLIC_BROWSER_PRESENTATION_SERVICE_DELEGATE_H_
8 #include "content/common/content_export.h"
10 namespace content {
12 class PresentationScreenAvailabilityListener;
14 // An interface implemented by embedders to handle presentation API calls
15 // forwarded from PresentationServiceImpl.
16 class CONTENT_EXPORT PresentationServiceDelegate {
17 public:
18 // Observer interface to listen for changes to PresentationServiceDelegate.
19 class CONTENT_EXPORT Observer {
20 public:
21 // Called when the PresentationServiceDelegate is being destroyed.
22 virtual void OnDelegateDestroyed() = 0;
24 protected:
25 virtual ~Observer() {}
28 virtual ~PresentationServiceDelegate() {}
30 // Registers an observer with this class to listen for updates to this class.
31 // This class does not own the observer.
32 // It is an error to add an observer if it has already been added before.
33 virtual void AddObserver(Observer* observer) = 0;
34 // Unregisters an observer with this class.
35 virtual void RemoveObserver(Observer* observer) = 0;
37 // Registers |listener| to continuously listen for
38 // availability updates for a presentation URL, originated from the frame
39 // given by |render_process_id| and |render_frame_id|.
40 // This class does not own |listener|.
41 // Returns true on success.
42 // This call will return false if a listener with the same presentation URL
43 // from the same frame is already registered.
44 virtual bool AddScreenAvailabilityListener(
45 int render_process_id,
46 int render_frame_id,
47 PresentationScreenAvailabilityListener* listener) = 0;
49 // Unregisters |listener| originated from the frame given by
50 // |render_process_id| and |render_frame_id| from this class. The listener
51 // will no longer receive availability updates.
52 virtual void RemoveScreenAvailabilityListener(
53 int render_process_id,
54 int render_frame_id,
55 PresentationScreenAvailabilityListener* listener) = 0;
57 // Unregisters all listeners associated with the frame given by
58 // |render_process_id| and |render_frame_id|.
59 virtual void RemoveAllScreenAvailabilityListeners(
60 int render_process_id,
61 int render_frame_id) = 0;
64 } // namespace content
66 #endif // CONTENT_PUBLIC_BROWSER_PRESENTATION_SERVICE_DELEGATE_H_