Chromium Code Reviews| 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..d4f358e2071df49d14057fa0813b6986aa8435f1 |
| --- /dev/null |
| +++ b/chrome/browser/media/webrtc/screen_capture_infobar_delegate_android.h |
| @@ -0,0 +1,53 @@ |
| +// 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; |
| +} |
| + |
| +// An infobar that allows the user to share their screen with the current page. |
| +class ScreenCaptureInfoBarDelegateAndroid : public ConfirmInfoBarDelegate { |
| + public: |
| + // Creates a screen capture infobar and delegate and adds the infobar to the |
| + // InfoBarService associated with |web_contents|. |
| + static void Create(content::WebContents* web_contents, |
| + const content::MediaStreamRequest& request, |
| + const content::MediaResponseCallback& callback); |
| + |
| + private: |
| + explicit ScreenCaptureInfoBarDelegateAndroid( |
|
Peter Kasting
2016/09/23 01:17:58
Nit: No need for explicit here
braveyao
2016/09/23 18:40:55
Done.
|
| + content::WebContents* web_contents, |
| + const content::MediaStreamRequest& request, |
| + const content::MediaResponseCallback& 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; |
| + |
| + // Runs |callback_| with the request result. If user grants the permission, |
| + // 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.
|
| + void RunCallback(content::MediaStreamRequestResult result); |
| + |
| + content::WebContents* web_contents_; |
| + const content::MediaStreamRequest request_; |
| + content::MediaResponseCallback callback_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ScreenCaptureInfoBarDelegateAndroid); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_MEDIA_WEBRTC_SCREEN_CAPTURE_INFOBAR_DELEGATE_ANDROID_H_ |