| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PERMISSIONS_PERMISSION_INFOBAR_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_INFOBAR_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_INFOBAR_DELEGATE_H_ | 6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_INFOBAR_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/browser/infobars/infobar_service.h" | 9 #include "chrome/browser/infobars/infobar_service.h" |
| 10 #include "components/content_settings/core/common/content_settings_types.h" | 10 #include "components/content_settings/core/common/content_settings_types.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 using PermissionSetCallback = base::Callback<void(bool, bool)>; | 24 using PermissionSetCallback = base::Callback<void(bool, bool)>; |
| 25 ContentSettingsType content_setting() const { return content_settings_type_; } | 25 ContentSettingsType content_setting() const { return content_settings_type_; } |
| 26 | 26 |
| 27 protected: | 27 protected: |
| 28 PermissionInfobarDelegate(const GURL& requesting_origin, | 28 PermissionInfobarDelegate(const GURL& requesting_origin, |
| 29 content::PermissionType permission_type, | 29 content::PermissionType permission_type, |
| 30 ContentSettingsType content_settings_type, | 30 ContentSettingsType content_settings_type, |
| 31 const PermissionSetCallback& callback); | 31 const PermissionSetCallback& callback); |
| 32 ~PermissionInfobarDelegate() override; | 32 ~PermissionInfobarDelegate() override; |
| 33 | 33 |
| 34 virtual int GetMessageResourceId() const = 0; |
| 35 |
| 34 private: | 36 private: |
| 35 // ConfirmInfoBarDelegate: | 37 // ConfirmInfoBarDelegate: |
| 36 Type GetInfoBarType() const override; | 38 Type GetInfoBarType() const override; |
| 37 void InfoBarDismissed() override; | 39 void InfoBarDismissed() override; |
| 38 PermissionInfobarDelegate* AsPermissionInfobarDelegate() override; | 40 PermissionInfobarDelegate* AsPermissionInfobarDelegate() override; |
| 39 base::string16 GetButtonLabel(InfoBarButton button) const override; | 41 base::string16 GetButtonLabel(InfoBarButton button) const override; |
| 42 base::string16 GetMessageText() const override; |
| 40 bool Accept() override; | 43 bool Accept() override; |
| 41 bool Cancel() override; | 44 bool Cancel() override; |
| 42 | 45 |
| 43 void SetPermission(bool update_content_setting, bool allowed); | 46 void SetPermission(bool update_content_setting, bool allowed); |
| 44 | 47 |
| 45 GURL requesting_origin_; | 48 GURL requesting_origin_; |
| 46 bool action_taken_; | 49 bool action_taken_; |
| 47 content::PermissionType permission_type_; | 50 content::PermissionType permission_type_; |
| 48 ContentSettingsType content_settings_type_; | 51 ContentSettingsType content_settings_type_; |
| 49 const PermissionSetCallback callback_; | 52 const PermissionSetCallback callback_; |
| 50 | 53 |
| 51 DISALLOW_COPY_AND_ASSIGN(PermissionInfobarDelegate); | 54 DISALLOW_COPY_AND_ASSIGN(PermissionInfobarDelegate); |
| 52 }; | 55 }; |
| 53 | 56 |
| 54 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_INFOBAR_DELEGATE_H_ | 57 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_INFOBAR_DELEGATE_H_ |
| OLD | NEW |