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

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: address comments; add tests; disregard unbookmarking 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..24d94a22770b75cd31e69cb1ae7a6af7e64ed5b4 100644
--- a/chrome/browser/storage/durable_storage_permission_context.h
+++ b/chrome/browser/storage/durable_storage_permission_context.h
@@ -5,16 +5,32 @@
#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;
+ void DecidePermission(content::WebContents* web_contents,
jsbell 2015/09/24 22:07:36 Can you add a short comment here w/ explanation of
dgrogan 2015/09/25 20:23:43 Done.
+ 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);
};

Powered by Google App Engine
This is Rietveld 408576698