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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2681933002: Add Java wrapper for RenderFrameHost (Closed)
Patch Set: Hold on to RFH main frame Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <utility> 10 #include <utility>
(...skipping 5051 matching lines...) Expand 10 before | Expand all | Expand 10 after
5062 } 5062 }
5063 5063
5064 #if defined(OS_ANDROID) 5064 #if defined(OS_ANDROID)
5065 5065
5066 base::android::ScopedJavaLocalRef<jobject> 5066 base::android::ScopedJavaLocalRef<jobject>
5067 WebContentsImpl::GetJavaWebContents() { 5067 WebContentsImpl::GetJavaWebContents() {
5068 DCHECK_CURRENTLY_ON(BrowserThread::UI); 5068 DCHECK_CURRENTLY_ON(BrowserThread::UI);
5069 return GetWebContentsAndroid()->GetJavaObject(); 5069 return GetWebContentsAndroid()->GetJavaObject();
5070 } 5070 }
5071 5071
5072 base::android::ScopedJavaLocalRef<jobject>
5073 WebContentsImpl::GetJavaRenderFrameHostDelegate() {
5074 return GetJavaWebContents();
5075 }
5076
5072 WebContentsAndroid* WebContentsImpl::GetWebContentsAndroid() { 5077 WebContentsAndroid* WebContentsImpl::GetWebContentsAndroid() {
5073 WebContentsAndroid* web_contents_android = 5078 WebContentsAndroid* web_contents_android =
5074 static_cast<WebContentsAndroid*>(GetUserData(kWebContentsAndroidKey)); 5079 static_cast<WebContentsAndroid*>(GetUserData(kWebContentsAndroidKey));
5075 if (!web_contents_android) { 5080 if (!web_contents_android) {
5076 web_contents_android = new WebContentsAndroid(this); 5081 web_contents_android = new WebContentsAndroid(this);
5077 SetUserData(kWebContentsAndroidKey, web_contents_android); 5082 SetUserData(kWebContentsAndroidKey, web_contents_android);
5078 } 5083 }
5079 return web_contents_android; 5084 return web_contents_android;
5080 } 5085 }
5081 5086
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
5439 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host); 5444 RenderViewHost* render_view_host = RenderViewHost::From(render_widget_host);
5440 if (!render_view_host) 5445 if (!render_view_host)
5441 continue; 5446 continue;
5442 render_view_host_set.insert(render_view_host); 5447 render_view_host_set.insert(render_view_host);
5443 } 5448 }
5444 for (RenderViewHost* render_view_host : render_view_host_set) 5449 for (RenderViewHost* render_view_host : render_view_host_set)
5445 render_view_host->OnWebkitPreferencesChanged(); 5450 render_view_host->OnWebkitPreferencesChanged();
5446 } 5451 }
5447 5452
5448 } // namespace content 5453 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698