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

Unified Diff: components/content_settings/core/browser/stub_content_settings_client.h

Issue 640753002: Introduce ContentSettingsClient interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@384873_move_interface_to_component
Patch Set: Errors fixed Created 6 years, 2 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: components/content_settings/core/browser/stub_content_settings_client.h
diff --git a/components/content_settings/core/browser/stub_content_settings_client.h b/components/content_settings/core/browser/stub_content_settings_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..346636f43107e4ab0d31c8db0802bd7f0784f4cc
--- /dev/null
+++ b/components/content_settings/core/browser/stub_content_settings_client.h
@@ -0,0 +1,59 @@
+// Copyright (c) 2014 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 COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_STUB_CONTENT_SETTINGS_CLIENT_H_
+#define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_STUB_CONTENT_SETTINGS_CLIENT_H_
+
+#include "components/content_settings/core/browser/content_settings_client.h"
+#include "components/content_settings/core/browser/stub_local_shared_objects_counter.h"
+
+namespace content_settings {
+
+// For test code only, to avoid the need to stub unneeded pure virtual methods
+// of ContentSettingsClient.
+class StubContentSettingsClient : public ContentSettingsClient {
+ public:
+ StubContentSettingsClient();
+ virtual ~StubContentSettingsClient();
+
+ // Stubbed methods of ContentSettingsClient.
+ virtual void OnCookiesRead(const GURL& url,
+ const GURL& first_party_url,
+ const net::CookieList& cookie_list,
+ bool blocked_by_policy) override;
+
+ virtual void OnCookieChanged(const GURL& url,
+ const GURL& first_party_url,
+ const std::string& cookie_line,
+ const net::CookieOptions& options,
+ bool blocked_by_policy) override;
+
+ virtual void OnFileSystemAccessed(const GURL& url,
+ bool blocked_by_policy) override;
+
+ virtual void OnIndexedDBAccessed(const GURL& url,
+ const base::string16& description,
+ bool blocked_by_policy) override;
+
+ virtual void OnLocalStorageAccessed(const GURL& url,
+ bool local,
+ bool blocked_by_policy) override;
+
+ virtual void OnWebDatabaseAccessed(const GURL& url,
+ const base::string16& name,
+ const base::string16& display_name,
+ bool blocked_by_policy) override;
+
+ virtual const LocalSharedObjectsCounter& local_shared_objects(
+ AccessType type) const override;
+
+ private:
+ StubLocalSharedObjectsCounter counter_;
+
+ DISALLOW_COPY_AND_ASSIGN(StubContentSettingsClient);
+};
+
+} // namespace content_settings
+
+#endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_STUB_CONTENT_SETTINGS_CLIENT_H_

Powered by Google App Engine
This is Rietveld 408576698