OLD | NEW |
---|---|
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 "android_webview/native/aw_contents.h" | 5 #include "android_webview/native/aw_contents.h" |
6 | 6 |
7 #include "android_webview/browser/net_disk_cache_remover.h" | 7 #include "android_webview/browser/net_disk_cache_remover.h" |
8 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" | 8 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" |
9 #include "android_webview/common/aw_hit_test_data.h" | 9 #include "android_webview/common/aw_hit_test_data.h" |
10 #include "android_webview/native/aw_browser_dependency_factory.h" | 10 #include "android_webview/native/aw_browser_dependency_factory.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
93 web_contents_.reset(dependency_factory->CreateWebContents(private_browsing)); | 93 web_contents_.reset(dependency_factory->CreateWebContents(private_browsing)); |
94 | 94 |
95 DCHECK(!AwContents::FromWebContents(web_contents_.get())); | 95 DCHECK(!AwContents::FromWebContents(web_contents_.get())); |
96 web_contents_->SetUserData(kAwContentsUserDataKey, | 96 web_contents_->SetUserData(kAwContentsUserDataKey, |
97 new AwContentsUserData(this)); | 97 new AwContentsUserData(this)); |
98 | 98 |
99 web_contents_->SetDelegate(web_contents_delegate_.get()); | 99 web_contents_->SetDelegate(web_contents_delegate_.get()); |
100 render_view_host_ext_.reset(new AwRenderViewHostExt(web_contents_.get())); | 100 render_view_host_ext_.reset(new AwRenderViewHostExt(web_contents_.get())); |
101 } | 101 } |
102 | 102 |
103 void AwContents::ReInit(JNIEnv* env, jobject obj, jint new_wc) { | |
joth
2012/11/16 06:24:31
InstallWebContents or SetWebContents ?
benm (inactive)
2012/11/16 12:29:09
Done.
| |
104 WebContents* wc = reinterpret_cast<WebContents*>(new_wc); | |
105 web_contents_.reset(wc); | |
joth
2012/11/16 06:24:31
|wc| seems unneeded here? just do the cast in the
benm (inactive)
2012/11/16 12:29:09
sg. Left over from when I was doing other things i
| |
106 web_contents_->SetUserData(kAwContentsUserDataKey, | |
107 new AwContentsUserData(this)); | |
108 | |
109 web_contents_->SetDelegate(web_contents_delegate_.get()); | |
110 render_view_host_ext_.reset(new AwRenderViewHostExt(web_contents_.get())); | |
joth
2012/11/16 06:24:31
factor out a method for all this and share with co
benm (inactive)
2012/11/16 12:29:09
Done.
| |
111 web_contents_->WasShown(); | |
joth
2012/11/16 06:24:31
seems odd to tuck a visibility state change into a
benm (inactive)
2012/11/16 12:29:09
mm, yeah. Kind of made sense while this is a "init
| |
112 } | |
113 | |
103 AwContents::~AwContents() { | 114 AwContents::~AwContents() { |
104 DCHECK(AwContents::FromWebContents(web_contents_.get()) == this); | 115 DCHECK(AwContents::FromWebContents(web_contents_.get()) == this); |
105 web_contents_->RemoveUserData(kAwContentsUserDataKey); | 116 web_contents_->RemoveUserData(kAwContentsUserDataKey); |
106 if (find_helper_.get()) | 117 if (find_helper_.get()) |
107 find_helper_->SetListener(NULL); | 118 find_helper_->SetListener(NULL); |
108 } | 119 } |
109 | 120 |
110 void AwContents::DrawGL(AwDrawGLInfo* draw_info) { | 121 void AwContents::DrawGL(AwDrawGLInfo* draw_info) { |
111 // TODO(joth): Do some drawing. | 122 // TODO(joth): Do some drawing. |
112 } | 123 } |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
372 int w, int h, int ow, int oh) { | 383 int w, int h, int ow, int oh) { |
373 // TODO(joth): Set Compositor size. | 384 // TODO(joth): Set Compositor size. |
374 } | 385 } |
375 | 386 |
376 void AwContents::SetWindowViewVisibility(JNIEnv* env, jobject obj, | 387 void AwContents::SetWindowViewVisibility(JNIEnv* env, jobject obj, |
377 bool window_visible, | 388 bool window_visible, |
378 bool view_visible) { | 389 bool view_visible) { |
379 // TODO(joth): Set the Compositor visibility. | 390 // TODO(joth): Set the Compositor visibility. |
380 } | 391 } |
381 | 392 |
393 void AwContents::SetPendingWebContentsForPopup(content::WebContents* pending) { | |
joth
2012/11/16 06:24:31
consider passing: scoped_ptr<WebContents> pending_
benm (inactive)
2012/11/16 12:29:09
Done.
| |
394 // TODO(benm): Support holding multiple pop up window requests. | |
395 DCHECK(!pending_contents_); | |
joth
2012/11/16 06:24:31
I'd be tempted to do:
if (pending_contents_) {
LO
benm (inactive)
2012/11/16 12:29:09
Done.
| |
396 pending_contents_.reset(pending); | |
397 } | |
398 | |
382 } // namespace android_webview | 399 } // namespace android_webview |
OLD | NEW |