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

Unified Diff: chromecast/renderer/cast_content_renderer_client.cc

Issue 801153003: Chromecast: add a CastRenderViewObserver for wiring up native bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/renderer/cast_content_renderer_client.cc
diff --git a/chromecast/renderer/cast_content_renderer_client.cc b/chromecast/renderer/cast_content_renderer_client.cc
index 6974d16ad46da3840cab8eac771f808822541149..0e8e504f2e614d1c4dc574d35a237f28ff24e919 100644
--- a/chromecast/renderer/cast_content_renderer_client.cc
+++ b/chromecast/renderer/cast_content_renderer_client.cc
@@ -17,6 +17,7 @@
#include "content/public/common/content_switches.h"
#include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_view.h"
+#include "content/public/renderer/render_view_observer.h"
#include "crypto/nss_util.h"
#include "third_party/WebKit/public/platform/WebColor.h"
#include "third_party/WebKit/public/web/WebSettings.h"
@@ -71,6 +72,22 @@ void PlatformPollFreemem(void) {
// though the comment of WebColor says it is in RGBA.
const blink::WebColor kColorBlack = 0xFF000000;
+class CastRenderViewObserver : content::RenderViewObserver {
+ public:
+ explicit CastRenderViewObserver(content::RenderView* render_view);
+ ~CastRenderViewObserver() override {}
+
+ void DidClearWindowObject(blink::WebLocalFrame* frame) override;
+};
+
+CastRenderViewObserver::CastRenderViewObserver(content::RenderView* render_view)
+ : content::RenderViewObserver(render_view) {
+}
+
+void CastRenderViewObserver::DidClearWindowObject(blink::WebLocalFrame* frame) {
+ // Native bindings go here.
+}
+
} // namespace
CastContentRendererClient::CastContentRendererClient() {
@@ -116,6 +133,9 @@ void CastContentRendererClient::RenderViewCreated(
// application running.
webview->settings()->setOfflineWebApplicationCacheEnabled(false);
}
+
+ // Note: RenderView will own the lifetime of its observer.
+ new CastRenderViewObserver(render_view);
}
void CastContentRendererClient::AddKeySystems(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698