OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 #ifndef UserMediaController_h | 25 #ifndef UserMediaController_h |
26 #define UserMediaController_h | 26 #define UserMediaController_h |
27 | 27 |
28 #include "core/page/Page.h" | 28 #include "core/page/Page.h" |
29 #include "modules/mediastream/UserMediaClient.h" | 29 #include "modules/mediastream/UserMediaClient.h" |
30 #include "wtf/PassOwnPtr.h" | 30 #include "wtf/PassOwnPtr.h" |
31 | 31 |
32 namespace WebCore { | 32 namespace WebCore { |
33 | 33 |
| 34 class MediaDevicesRequest; |
34 class UserMediaRequest; | 35 class UserMediaRequest; |
35 | 36 |
36 class UserMediaController FINAL : public Supplement<Page> { | 37 class UserMediaController FINAL : public Supplement<Page> { |
37 public: | 38 public: |
38 virtual ~UserMediaController(); | 39 virtual ~UserMediaController(); |
39 | 40 |
40 UserMediaClient* client() const { return m_client; } | 41 UserMediaClient* client() const { return m_client; } |
| 42 |
41 void requestUserMedia(PassRefPtr<UserMediaRequest>); | 43 void requestUserMedia(PassRefPtr<UserMediaRequest>); |
42 void cancelUserMediaRequest(UserMediaRequest*); | 44 void cancelUserMediaRequest(UserMediaRequest*); |
43 | 45 |
| 46 void requestMediaDevices(PassRefPtr<MediaDevicesRequest>); |
| 47 void cancelMediaDevicesRequest(MediaDevicesRequest*); |
| 48 |
44 static PassOwnPtr<UserMediaController> create(UserMediaClient*); | 49 static PassOwnPtr<UserMediaController> create(UserMediaClient*); |
45 static const char* supplementName(); | 50 static const char* supplementName(); |
46 static UserMediaController* from(Page* page) { return static_cast<UserMediaC
ontroller*>(Supplement<Page>::from(page, supplementName())); } | 51 static UserMediaController* from(Page* page) { return static_cast<UserMediaC
ontroller*>(Supplement<Page>::from(page, supplementName())); } |
47 | 52 |
48 protected: | 53 protected: |
49 explicit UserMediaController(UserMediaClient*); | 54 explicit UserMediaController(UserMediaClient*); |
50 | 55 |
51 private: | 56 private: |
52 UserMediaClient* m_client; | 57 UserMediaClient* m_client; |
53 }; | 58 }; |
54 | 59 |
55 inline void UserMediaController::requestUserMedia(PassRefPtr<UserMediaRequest> r
equest) | 60 inline void UserMediaController::requestUserMedia(PassRefPtr<UserMediaRequest> r
equest) |
56 { | 61 { |
57 m_client->requestUserMedia(request); | 62 m_client->requestUserMedia(request); |
58 } | 63 } |
59 | 64 |
60 inline void UserMediaController::cancelUserMediaRequest(UserMediaRequest* reques
t) | 65 inline void UserMediaController::cancelUserMediaRequest(UserMediaRequest* reques
t) |
61 { | 66 { |
62 m_client->cancelUserMediaRequest(request); | 67 m_client->cancelUserMediaRequest(request); |
63 } | 68 } |
64 | 69 |
| 70 inline void UserMediaController::requestMediaDevices(PassRefPtr<MediaDevicesRequ
est> request) |
| 71 { |
| 72 m_client->requestMediaDevices(request); |
| 73 } |
| 74 |
| 75 inline void UserMediaController::cancelMediaDevicesRequest(MediaDevicesRequest*
request) |
| 76 { |
| 77 m_client->cancelMediaDevicesRequest(request); |
| 78 } |
| 79 |
65 } // namespace WebCore | 80 } // namespace WebCore |
66 | 81 |
67 #endif // UserMediaController_h | 82 #endif // UserMediaController_h |
OLD | NEW |