Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Side by Side Diff: chrome/browser/permissions/grouped_permission_infobar_delegate.h

Issue 2254763002: Enable the optional permission prompt persistence toggle on grouped infobars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permission-infobardelegate-clean
Patch Set: DCHECK -> CHECK Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 bool ShouldShowPersistenceToggle() const;
37 bool persist() const { return persist_; }
38 void set_persist(bool persist) { persist_ = persist; }
39
36 base::string16 GetMessageText() const override; 40 base::string16 GetMessageText() const override;
37 41
38 int GetPermissionCount() const; 42 int GetPermissionCount() const;
39 ContentSettingsType GetContentSettingType(int index) const; 43 ContentSettingsType GetContentSettingType(int index) const;
40 int GetIconIdForPermission(int index) const; 44 int GetIconIdForPermission(int index) const;
41 // Message text to display for an individual permission at |index|. 45 // Message text to display for an individual permission at |index|.
42 base::string16 GetMessageTextFragment(int index) const; 46 base::string16 GetMessageTextFragment(int index) const;
43 47
44 void ToggleAccept(int position, bool new_value); 48 void ToggleAccept(int position, bool new_value);
45 49
46 protected: 50 protected:
47 bool GetAcceptState(int position); 51 bool GetAcceptState(int position);
48 52
49 private: 53 private:
50 // ConfirmInfoBarDelegate: 54 // ConfirmInfoBarDelegate:
51 base::string16 GetButtonLabel(InfoBarButton button) const override; 55 base::string16 GetButtonLabel(InfoBarButton button) const override;
52 int GetButtons() const override; 56 int GetButtons() const override;
53 57
54 // InfoBarDelegate: 58 // InfoBarDelegate:
55 Type GetInfoBarType() const override; 59 Type GetInfoBarType() const override;
56 60
57 const GURL requesting_origin_; 61 const GURL requesting_origin_;
58 const std::vector<ContentSettingsType> types_; 62 const std::vector<ContentSettingsType> types_;
59 std::vector<bool> accept_states_; 63 std::vector<bool> accept_states_;
64 bool persist_;
60 65
61 DISALLOW_COPY_AND_ASSIGN(GroupedPermissionInfoBarDelegate); 66 DISALLOW_COPY_AND_ASSIGN(GroupedPermissionInfoBarDelegate);
62 }; 67 };
63 68
64 #endif // CHROME_BROWSER_PERMISSIONS_GROUPED_PERMISSION_INFOBAR_DELEGATE_H_ 69 #endif // CHROME_BROWSER_PERMISSIONS_GROUPED_PERMISSION_INFOBAR_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698