| Index: chrome/browser/permissions/permission_decision_auto_blocker.h
|
| diff --git a/chrome/browser/permissions/permission_decision_auto_blocker.h b/chrome/browser/permissions/permission_decision_auto_blocker.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..2b02f5fe7b4d55d40186cf5604fe0ae046e46489
|
| --- /dev/null
|
| +++ b/chrome/browser/permissions/permission_decision_auto_blocker.h
|
| @@ -0,0 +1,49 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_DECISION_AUTO_BLOCKER_H_
|
| +#define CHROME_BROWSER_PERMISSIONS_PERMISSION_DECISION_AUTO_BLOCKER_H_
|
| +
|
| +#include "base/callback_forward.h"
|
| +#include "base/macros.h"
|
| +#include "content/public/browser/permission_type.h"
|
| +#include "url/gurl.h"
|
| +
|
| +class GURL;
|
| +class Profile;
|
| +
|
| +class PermissionDecisionAutoBlocker {
|
| + public:
|
| + static void RemoveCountsByUrl(Profile* profile,
|
| + base::Callback<bool(const GURL& url)> filter);
|
| +
|
| + PermissionDecisionAutoBlocker();
|
| + bool ShouldChangeDismissalToBlock(Profile* profile,
|
| + const GURL& url,
|
| + content::PermissionType permission);
|
| +
|
| + private:
|
| + friend class PermissionContextBaseTests;
|
| + friend class PermissionDecisionAutoBlockerUnitTest;
|
| +
|
| + static const char kPromptDismissCountKey[];
|
| +
|
| + // Returns the current number of dismissals for |permission| type at |url|.
|
| + // Exposed for testing.
|
| + int GetDismissalCount(Profile* profile,
|
| + const GURL& url,
|
| + content::PermissionType permission);
|
| +
|
| + // Records that the user dismissed a permission prompt for type |permission|
|
| + // on |url| to a website setting. Returns the updated number of dismissals.
|
| + int RecordDismissalCount(Profile* profile,
|
| + const GURL& url,
|
| + content::PermissionType permission);
|
| +
|
| + void UpdateFromVariations();
|
| +
|
| + int prompt_dismissals_before_block_;
|
| +};
|
| +
|
| +#endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_DECISION_AUTO_BLOCKER_H_
|
|
|