| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_SCREEN_CAPTURE_INFOBAR_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_SCREEN_CAPTURE_INFOBAR_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_UI_SCREEN_CAPTURE_INFOBAR_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_SCREEN_CAPTURE_INFOBAR_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" | 9 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" |
| 10 #include "content/public/browser/web_contents_delegate.h" | 10 #include "content/public/browser/web_contents_delegate.h" |
| 11 #include "content/public/common/media_stream_request.h" | 11 #include "content/public/common/media_stream_request.h" |
| 12 | 12 |
| 13 class InfoBarService; | 13 class InfoBarService; |
| 14 class ScreenCaptureConfirmationUIInfobar; |
| 14 | 15 |
| 15 class ScreenCaptureInfoBarDelegate : public ConfirmInfoBarDelegate { | 16 class ScreenCaptureInfoBarDelegate : public ConfirmInfoBarDelegate { |
| 16 public: | 17 public: |
| 17 static void Create( | 18 ScreenCaptureInfoBarDelegate( |
| 18 content::WebContents* web_contents, | 19 InfoBarService* infobar_service, |
| 19 const content::MediaStreamRequest& request, | 20 const string16& application_name, |
| 20 const content::MediaResponseCallback& callback); | 21 ScreenCaptureConfirmationUIInfobar* result_handler); |
| 21 | 22 |
| 22 virtual ~ScreenCaptureInfoBarDelegate(); | 23 virtual ~ScreenCaptureInfoBarDelegate(); |
| 23 | 24 |
| 24 private: | 25 private: |
| 25 ScreenCaptureInfoBarDelegate( | |
| 26 InfoBarService* infobar_service, | |
| 27 const content::MediaStreamRequest& request, | |
| 28 const content::MediaResponseCallback& callback); | |
| 29 | 26 |
| 30 // Base class: ConfirmInfoBarDelegate. | 27 // Base class: ConfirmInfoBarDelegate. |
| 31 virtual bool EqualsDelegate(InfoBarDelegate* delegate) const OVERRIDE; | |
| 32 virtual void InfoBarDismissed() OVERRIDE; | 28 virtual void InfoBarDismissed() OVERRIDE; |
| 33 virtual Type GetInfoBarType() const OVERRIDE; | 29 virtual Type GetInfoBarType() const OVERRIDE; |
| 34 virtual ScreenCaptureInfoBarDelegate* | 30 virtual ScreenCaptureInfoBarDelegate* |
| 35 AsScreenCaptureInfoBarDelegate() OVERRIDE; | 31 AsScreenCaptureInfoBarDelegate() OVERRIDE; |
| 36 virtual string16 GetMessageText() const OVERRIDE; | 32 virtual string16 GetMessageText() const OVERRIDE; |
| 37 virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; | 33 virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; |
| 38 virtual bool Accept() OVERRIDE; | 34 virtual bool Accept() OVERRIDE; |
| 39 virtual bool Cancel() OVERRIDE; | 35 virtual bool Cancel() OVERRIDE; |
| 40 | 36 |
| 41 void Deny(); | 37 ScreenCaptureConfirmationUIInfobar* result_handler_; |
| 42 | 38 const string16 application_name_; |
| 43 const content::MediaStreamRequest request_; | |
| 44 const content::MediaResponseCallback callback_; | |
| 45 | 39 |
| 46 DISALLOW_COPY_AND_ASSIGN(ScreenCaptureInfoBarDelegate); | 40 DISALLOW_COPY_AND_ASSIGN(ScreenCaptureInfoBarDelegate); |
| 47 }; | 41 }; |
| 48 | 42 |
| 49 #endif // CHROME_BROWSER_UI_SCREEN_CAPTURE_INFOBAR_DELEGATE_H_ | 43 #endif // CHROME_BROWSER_UI_SCREEN_CAPTURE_INFOBAR_DELEGATE_H_ |
| OLD | NEW |