OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 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. | |
4 | |
5 #ifndef CHROME_BROWSER_MEDIA_WEBRTC_SCREEN_CAPTURE_INFOBAR_DELEGATE_ANDROID_H_ | |
6 #define CHROME_BROWSER_MEDIA_WEBRTC_SCREEN_CAPTURE_INFOBAR_DELEGATE_ANDROID_H_ | |
7 | |
8 #include "chrome/browser/media/media_access_handler.h" | |
9 #include "components/infobars/core/confirm_infobar_delegate.h" | |
10 | |
11 namespace content { | |
12 class WebContents; | |
13 } | |
14 | |
15 // An infobar that allows the user to share their screen with the current page. | |
16 class ScreenCaptureInfoBarDelegateAndroid : public ConfirmInfoBarDelegate { | |
17 public: | |
18 // Creates a screen capture infobar and delegate and adds the infobar to the | |
19 // InfoBarService associated with |web_contents|. | |
20 static void Create(content::WebContents* web_contents, | |
21 const content::MediaStreamRequest& request, | |
22 const content::MediaResponseCallback& callback); | |
23 | |
24 private: | |
25 explicit ScreenCaptureInfoBarDelegateAndroid( | |
Peter Kasting
2016/09/23 01:17:58
Nit: No need for explicit here
braveyao
2016/09/23 18:40:55
Done.
| |
26 content::WebContents* web_contents, | |
27 const content::MediaStreamRequest& request, | |
28 const content::MediaResponseCallback& callback); | |
29 ~ScreenCaptureInfoBarDelegateAndroid() override; | |
30 | |
31 // ConfirmInfoBarDelegate: | |
32 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; | |
33 ScreenCaptureInfoBarDelegateAndroid* AsScreenCaptureInfoBarDelegateAndroid() | |
34 override; | |
35 base::string16 GetMessageText() const override; | |
36 int GetIconId() const override; | |
37 base::string16 GetButtonLabel(InfoBarButton button) const override; | |
38 bool Accept() override; | |
39 bool Cancel() override; | |
40 void InfoBarDismissed() override; | |
41 | |
42 // Runs |callback_| with the request result. If user grants the permission, | |
43 // notify WebRTC with corresponding screen device and UI object. | |
Peter Kasting
2016/09/23 01:17:58
Nit: These sound like two separate actions, and te
braveyao
2016/09/23 18:40:55
Done.
| |
44 void RunCallback(content::MediaStreamRequestResult result); | |
45 | |
46 content::WebContents* web_contents_; | |
47 const content::MediaStreamRequest request_; | |
48 content::MediaResponseCallback callback_; | |
49 | |
50 DISALLOW_COPY_AND_ASSIGN(ScreenCaptureInfoBarDelegateAndroid); | |
51 }; | |
52 | |
53 #endif // CHROME_BROWSER_MEDIA_WEBRTC_SCREEN_CAPTURE_INFOBAR_DELEGATE_ANDROID_H _ | |
OLD | NEW |