| 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 <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 // Returns true if the infobar should display a toggle to allow users to | 60 // Returns true if the infobar should display a toggle to allow users to |
| 61 // opt-out of persisting their accept/deny decision. | 61 // opt-out of persisting their accept/deny decision. |
| 62 bool ShouldShowPersistenceToggle() const; | 62 bool ShouldShowPersistenceToggle() const; |
| 63 | 63 |
| 64 // Sets whether or not a decided permission should be persisted to content | 64 // Sets whether or not a decided permission should be persisted to content |
| 65 // settings. | 65 // settings. |
| 66 void set_persist(bool persist) { persist_ = persist; } | 66 void set_persist(bool persist) { persist_ = persist; } |
| 67 bool persist() const { return persist_; } | 67 bool persist() const { return persist_; } |
| 68 | 68 |
| 69 bool user_gesture() const { return user_gesture_; } |
| 70 |
| 69 // ConfirmInfoBarDelegate: | 71 // ConfirmInfoBarDelegate: |
| 70 bool Accept() override; | 72 bool Accept() override; |
| 71 bool Cancel() override; | 73 bool Cancel() override; |
| 72 void InfoBarDismissed() override; | 74 void InfoBarDismissed() override; |
| 73 base::string16 GetButtonLabel(InfoBarButton button) const override; | 75 base::string16 GetButtonLabel(InfoBarButton button) const override; |
| 74 base::string16 GetMessageText() const override; | 76 base::string16 GetMessageText() const override; |
| 75 | 77 |
| 76 protected: | 78 protected: |
| 77 PermissionInfoBarDelegate(const GURL& requesting_origin, | 79 PermissionInfoBarDelegate(const GURL& requesting_origin, |
| 78 content::PermissionType permission_type, | 80 content::PermissionType permission_type, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 99 bool persist_; | 101 bool persist_; |
| 100 | 102 |
| 101 DISALLOW_COPY_AND_ASSIGN(PermissionInfoBarDelegate); | 103 DISALLOW_COPY_AND_ASSIGN(PermissionInfoBarDelegate); |
| 102 }; | 104 }; |
| 103 | 105 |
| 104 // Implemented in platform-specific code. | 106 // Implemented in platform-specific code. |
| 105 std::unique_ptr<infobars::InfoBar> CreatePermissionInfoBar( | 107 std::unique_ptr<infobars::InfoBar> CreatePermissionInfoBar( |
| 106 std::unique_ptr<PermissionInfoBarDelegate> delegate); | 108 std::unique_ptr<PermissionInfoBarDelegate> delegate); |
| 107 | 109 |
| 108 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_INFOBAR_DELEGATE_H_ | 110 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_INFOBAR_DELEGATE_H_ |
| OLD | NEW |