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

Unified Diff: chrome/browser/storage/durable_storage_permission_context.h

Issue 1356813002: Autogrant the durable storage permission to bookmarked origins (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: EXPECT_EQ -> EXPECT_TRUE/FALSE Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/storage/durable_storage_permission_context.h
diff --git a/chrome/browser/storage/durable_storage_permission_context.h b/chrome/browser/storage/durable_storage_permission_context.h
index 58757498ac3cc587abd6d3f8eb9b5b7b6c6e01b7..f6683d0002e7d2346b70fd7c09f81be7adfe4167 100644
--- a/chrome/browser/storage/durable_storage_permission_context.h
+++ b/chrome/browser/storage/durable_storage_permission_context.h
@@ -5,16 +5,33 @@
#ifndef CHROME_BROWSER_STORAGE_DURABLE_STORAGE_PERMISSION_CONTEXT_H_
#define CHROME_BROWSER_STORAGE_DURABLE_STORAGE_PERMISSION_CONTEXT_H_
+#include <vector>
+
#include "chrome/browser/permissions/permission_context_base.h"
+#include "components/bookmarks/browser/bookmark_model.h"
class DurableStoragePermissionContext : public PermissionContextBase {
public:
explicit DurableStoragePermissionContext(Profile* profile);
~DurableStoragePermissionContext() override = default;
+ // Grant if requesting_origin is bookmarked or already granted.
+ void DecidePermission(content::WebContents* web_contents,
+ const PermissionRequestID& id,
+ const GURL& requesting_origin,
+ const GURL& embedding_origin,
+ bool user_gesture,
+ const BrowserPermissionCallback& callback) override;
bool IsRestrictedToSecureOrigins() const override;
private:
+ FRIEND_TEST_ALL_PREFIXES(BookmarksOriginTest, Exists);
+ FRIEND_TEST_ALL_PREFIXES(BookmarksOriginTest, DoesntExist);
+
+ static bool IsOriginBookmarked(
+ const std::vector<bookmarks::BookmarkModel::URLAndTitle>& bookmarks,
+ const GURL& origin);
+
DISALLOW_COPY_AND_ASSIGN(DurableStoragePermissionContext);
};
« no previous file with comments | « chrome/browser/storage/durable_storage_browsertest.cc ('k') | chrome/browser/storage/durable_storage_permission_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698