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

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

Issue 2154033003: Add gesture type value from infobar to permission report (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add-user-gesture-from-permission-layer-to-permission-report
Patch Set: nit Created 4 years, 4 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 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 11 matching lines...) Expand all
22 class PermissionInfobarDelegate : public ConfirmInfoBarDelegate { 22 class PermissionInfobarDelegate : public ConfirmInfoBarDelegate {
23 23
24 public: 24 public:
25 using PermissionSetCallback = base::Callback<void(bool, bool)>; 25 using PermissionSetCallback = base::Callback<void(bool, bool)>;
26 ContentSettingsType content_setting() const { return content_settings_type_; } 26 ContentSettingsType content_setting() const { return content_settings_type_; }
27 27
28 protected: 28 protected:
29 PermissionInfobarDelegate(const GURL& requesting_origin, 29 PermissionInfobarDelegate(const GURL& requesting_origin,
30 content::PermissionType permission_type, 30 content::PermissionType permission_type,
31 ContentSettingsType content_settings_type, 31 ContentSettingsType content_settings_type,
32 bool user_gesture,
32 Profile* profile, 33 Profile* profile,
33 const PermissionSetCallback& callback); 34 const PermissionSetCallback& callback);
34 ~PermissionInfobarDelegate() override; 35 ~PermissionInfobarDelegate() override;
35 36
36 virtual int GetMessageResourceId() const = 0; 37 virtual int GetMessageResourceId() const = 0;
37 38
38 private: 39 private:
39 // ConfirmInfoBarDelegate: 40 // ConfirmInfoBarDelegate:
40 Type GetInfoBarType() const override; 41 Type GetInfoBarType() const override;
41 void InfoBarDismissed() override; 42 void InfoBarDismissed() override;
42 PermissionInfobarDelegate* AsPermissionInfobarDelegate() override; 43 PermissionInfobarDelegate* AsPermissionInfobarDelegate() override;
43 base::string16 GetButtonLabel(InfoBarButton button) const override; 44 base::string16 GetButtonLabel(InfoBarButton button) const override;
44 base::string16 GetMessageText() const override; 45 base::string16 GetMessageText() const override;
45 bool Accept() override; 46 bool Accept() override;
46 bool Cancel() override; 47 bool Cancel() override;
47 48
48 void SetPermission(bool update_content_setting, bool allowed); 49 void SetPermission(bool update_content_setting, bool allowed);
49 50
50 GURL requesting_origin_; 51 GURL requesting_origin_;
51 bool action_taken_; 52 bool action_taken_;
52 content::PermissionType permission_type_; 53 content::PermissionType permission_type_;
53 ContentSettingsType content_settings_type_; 54 ContentSettingsType content_settings_type_;
55 bool user_gesture_;
54 Profile* const profile_; 56 Profile* const profile_;
55 const PermissionSetCallback callback_; 57 const PermissionSetCallback callback_;
56 58
57 DISALLOW_COPY_AND_ASSIGN(PermissionInfobarDelegate); 59 DISALLOW_COPY_AND_ASSIGN(PermissionInfobarDelegate);
58 }; 60 };
59 61
60 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_INFOBAR_DELEGATE_H_ 62 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_INFOBAR_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698