| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_GROUPED_PERMISSION_INFOBAR_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_PERMISSIONS_GROUPED_PERMISSION_INFOBAR_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_PERMISSIONS_GROUPED_PERMISSION_INFOBAR_DELEGATE_H_ | 6 #define CHROME_BROWSER_PERMISSIONS_GROUPED_PERMISSION_INFOBAR_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // Implementation is in platform-specific infobar file. | 26 // Implementation is in platform-specific infobar file. |
| 27 static std::unique_ptr<infobars::InfoBar> CreateInfoBar( | 27 static std::unique_ptr<infobars::InfoBar> CreateInfoBar( |
| 28 infobars::InfoBarManager* infobar_manager, | 28 infobars::InfoBarManager* infobar_manager, |
| 29 std::unique_ptr<GroupedPermissionInfoBarDelegate> delegate); | 29 std::unique_ptr<GroupedPermissionInfoBarDelegate> delegate); |
| 30 | 30 |
| 31 GroupedPermissionInfoBarDelegate( | 31 GroupedPermissionInfoBarDelegate( |
| 32 const GURL& requesting_origin, | 32 const GURL& requesting_origin, |
| 33 const std::vector<ContentSettingsType>& types); | 33 const std::vector<ContentSettingsType>& types); |
| 34 ~GroupedPermissionInfoBarDelegate() override; | 34 ~GroupedPermissionInfoBarDelegate() override; |
| 35 | 35 |
| 36 // Message text that displays at the top of the infobar. | |
| 37 base::string16 GetMessageText() const override; | 36 base::string16 GetMessageText() const override; |
| 38 | 37 |
| 39 int GetPermissionCount() const; | 38 int GetPermissionCount() const; |
| 40 ContentSettingsType GetContentSettingType(int index) const; | 39 ContentSettingsType GetContentSettingType(int index) const; |
| 41 int GetIconIdForPermission(int index) const; | 40 int GetIconIdForPermission(int index) const; |
| 42 // Message text to display for an individual permission at |index|. | 41 // Message text to display for an individual permission at |index|. |
| 43 base::string16 GetMessageTextFragment(int index) const; | 42 base::string16 GetMessageTextFragment(int index) const; |
| 44 | 43 |
| 44 void ToggleAccept(int position, bool new_value); |
| 45 |
| 46 protected: |
| 47 bool GetAcceptState(int position); |
| 48 |
| 45 private: | 49 private: |
| 46 // ConfirmInfoBarDelegate: | 50 // ConfirmInfoBarDelegate: |
| 47 base::string16 GetButtonLabel(InfoBarButton button) const override; | 51 base::string16 GetButtonLabel(InfoBarButton button) const override; |
| 52 int GetButtons() const override; |
| 48 | 53 |
| 49 // InfoBarDelegate: | 54 // InfoBarDelegate: |
| 50 Type GetInfoBarType() const override; | 55 Type GetInfoBarType() const override; |
| 51 | 56 |
| 52 const GURL requesting_origin_; | 57 const GURL requesting_origin_; |
| 53 const std::vector<ContentSettingsType> types_; | 58 const std::vector<ContentSettingsType> types_; |
| 59 std::vector<bool> accept_states_; |
| 54 | 60 |
| 55 DISALLOW_COPY_AND_ASSIGN(GroupedPermissionInfoBarDelegate); | 61 DISALLOW_COPY_AND_ASSIGN(GroupedPermissionInfoBarDelegate); |
| 56 }; | 62 }; |
| 57 | 63 |
| 58 #endif // CHROME_BROWSER_PERMISSIONS_GROUPED_PERMISSION_INFOBAR_DELEGATE_H_ | 64 #endif // CHROME_BROWSER_PERMISSIONS_GROUPED_PERMISSION_INFOBAR_DELEGATE_H_ |
| OLD | NEW |