Index: chrome/browser/media/webrtc/screen_capture_infobar_delegate_android.h |
diff --git a/chrome/browser/media/webrtc/screen_capture_infobar_delegate_android.h b/chrome/browser/media/webrtc/screen_capture_infobar_delegate_android.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..552fedd74e50ab0525f1aba5d9b9450f138b35e4 |
--- /dev/null |
+++ b/chrome/browser/media/webrtc/screen_capture_infobar_delegate_android.h |
@@ -0,0 +1,55 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_MEDIA_WEBRTC_SCREEN_CAPTURE_INFOBAR_DELEGATE_ANDROID_H_ |
+#define CHROME_BROWSER_MEDIA_WEBRTC_SCREEN_CAPTURE_INFOBAR_DELEGATE_ANDROID_H_ |
+ |
+#include "chrome/browser/media/media_access_handler.h" |
+#include "components/infobars/core/confirm_infobar_delegate.h" |
+ |
+namespace content { |
+class WebContents; |
+} |
+ |
+// This class configures an infobar shown when a page requests access to a |
+// user's device screen. The user is shown a message asking whether he wishes to |
tsergeant
2016/09/19 23:27:02
Please try and avoid gender-specific pronouns in c
braveyao
2016/09/20 00:50:05
Done.
|
+// share his screen with the current page, and buttons to give access to the |
+// screen to the page, or to deny access to it. |
+class ScreenCaptureInfoBarDelegateAndroid : public ConfirmInfoBarDelegate { |
+ public: |
+ typedef content::MediaResponseCallback ResponseCallback; |
+ |
+ // Static method to create the object |
+ static void Create(content::WebContents* web_contents, |
+ const content::MediaStreamRequest& request, |
+ const ResponseCallback& callback); |
+ |
+ explicit ScreenCaptureInfoBarDelegateAndroid( |
+ content::WebContents* web_contents, |
+ const content::MediaStreamRequest& request, |
+ const ResponseCallback& callback); |
+ ~ScreenCaptureInfoBarDelegateAndroid() override; |
+ |
+ // ConfirmInfoBarDelegate: |
+ infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; |
+ ScreenCaptureInfoBarDelegateAndroid* AsScreenCaptureInfoBarDelegateAndroid() |
+ override; |
+ base::string16 GetMessageText() const override; |
+ int GetIconId() const override; |
+ base::string16 GetButtonLabel(InfoBarButton button) const override; |
+ bool Accept() override; |
+ bool Cancel() override; |
+ void InfoBarDismissed() override; |
+ |
+ private: |
+ void RunCallback(content::MediaStreamRequestResult result); |
+ |
+ content::WebContents* web_contents_; |
+ const content::MediaStreamRequest request_; |
+ const ResponseCallback granted_callback_; |
tsergeant
2016/09/19 23:27:02
Nit: I would just call this `callback_` rather tha
braveyao
2016/09/20 00:50:06
Done.
|
+ |
+ DISALLOW_COPY_AND_ASSIGN(ScreenCaptureInfoBarDelegateAndroid); |
+}; |
+ |
+#endif // CHROME_BROWSER_MEDIA_WEBRTC_SCREEN_CAPTURE_INFOBAR_DELEGATE_ANDROID_H_ |