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

Unified Diff: content/public/common/content_client.h

Issue 13409003: Hide ContentClient getters from embedders so that they they don't reuse content's embedder API. The… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 7 years, 8 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
« no previous file with comments | « content/public/browser/content_browser_client.h ('k') | content/public/common/content_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/common/content_client.h
===================================================================
--- content/public/common/content_client.h (revision 192622)
+++ content/public/common/content_client.h (working copy)
@@ -57,8 +57,19 @@
// Setter and getter for the client. The client should be set early, before any
// content code is called.
CONTENT_EXPORT void SetContentClient(ContentClient* client);
-CONTENT_EXPORT ContentClient* GetContentClient();
+#if defined(CONTENT_IMPLEMENTATION)
+// Content's embedder API should only be used by content.
+ContentClient* GetContentClient();
+#endif
+
+// Used for tests to override the relevant embedder interfaces. Each method
+// returns the old value.
+CONTENT_EXPORT ContentBrowserClient* SetBrowserClientForTesting(
+ ContentBrowserClient* b);
+CONTENT_EXPORT ContentRendererClient* SetRendererClientForTesting(
+ ContentRendererClient* r);
+
// Returns the user agent string being used by the browser. SetContentClient()
// must be called prior to calling this, and this routine must be used
// instead of webkit_glue::GetUserAgent() in order to ensure that we use
@@ -154,11 +165,9 @@
virtual std::string GetCarbonInterposePath() const;
#endif
- void set_browser_for_testing(ContentBrowserClient* c) { browser_ = c; }
- void set_renderer_for_testing(ContentRendererClient* r) { renderer_ = r; }
-
private:
friend class ContentClientInitializer; // To set these pointers.
+ friend class InternalTestInitializer;
// The embedder API for participating in browser logic.
ContentBrowserClient* browser_;
« no previous file with comments | « content/public/browser/content_browser_client.h ('k') | content/public/common/content_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698