summaryrefslogtreecommitdiffstats
path: root/android_webview/browser
diff options
context:
space:
mode:
authorboliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-21 05:43:03 +0000
committerboliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-21 05:43:03 +0000
commit9df94ae9a38f1959f7cec1a0666bbc9d9e6f42cb (patch)
treeea9b3c18ec88f5ada9940aa6f94d0b41ac275a02 /android_webview/browser
parent2686040bc4b822b94cc5a08571a5210486428fa1 (diff)
downloadchromium_src-9df94ae9a38f1959f7cec1a0666bbc9d9e6f42cb.zip
chromium_src-9df94ae9a38f1959f7cec1a0666bbc9d9e6f42cb.tar.gz
chromium_src-9df94ae9a38f1959f7cec1a0666bbc9d9e6f42cb.tar.bz2
Clean up AwContents calls to change visibility
Visibility is stored in AwContents and native BrowserViewRenderer. It seems to be windowVisible && viewVisible && !mIsPaused. So clean all this up, make sure we don't make unnecessary calls into ContentViewCore. Precursor work to pass visibility from BrowserViewRenderer directly to cc. BUG=250594 NOTRY=true Review URL: https://chromiumcodereview.appspot.com/17291010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207720 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview/browser')
-rw-r--r--android_webview/browser/browser_view_renderer.h2
-rw-r--r--android_webview/browser/in_process_view_renderer.cc19
-rw-r--r--android_webview/browser/in_process_view_renderer.h5
3 files changed, 11 insertions, 15 deletions
diff --git a/android_webview/browser/browser_view_renderer.h b/android_webview/browser/browser_view_renderer.h
index dad70ed..608d038 100644
--- a/android_webview/browser/browser_view_renderer.h
+++ b/android_webview/browser/browser_view_renderer.h
@@ -99,7 +99,7 @@ class BrowserViewRenderer {
virtual void EnableOnNewPicture(bool enabled) = 0;
// View update notifications.
- virtual void OnVisibilityChanged(bool view_visible, bool window_visible) = 0;
+ virtual void OnVisibilityChanged(bool visible) = 0;
virtual void OnSizeChanged(int width, int height) = 0;
virtual void OnAttachedToWindow(int width, int height) = 0;
virtual void OnDetachedFromWindow() = 0;
diff --git a/android_webview/browser/in_process_view_renderer.cc b/android_webview/browser/in_process_view_renderer.cc
index acb6db8..ce55d1f 100644
--- a/android_webview/browser/in_process_view_renderer.cc
+++ b/android_webview/browser/in_process_view_renderer.cc
@@ -306,7 +306,7 @@ InProcessViewRenderer::InProcessViewRenderer(
java_helper_(java_helper),
web_contents_(web_contents),
compositor_(NULL),
- view_visible_(false),
+ visible_(false),
dip_scale_(0.0),
continuous_invalidate_(false),
block_invalidates_(false),
@@ -364,7 +364,7 @@ void InProcessViewRenderer::DrawGL(AwDrawGLInfo* draw_info) {
return;
TRACE_EVENT0("android_webview", "InProcessViewRenderer::DrawGL");
- DCHECK(view_visible_);
+ DCHECK(visible_);
// We need to watch if the current Android context has changed and enforce
// a clean-up in the compositor.
@@ -553,16 +553,13 @@ InProcessViewRenderer::CapturePicture() {
void InProcessViewRenderer::EnableOnNewPicture(bool enabled) {
}
-void InProcessViewRenderer::OnVisibilityChanged(bool view_visible,
- bool window_visible) {
- TRACE_EVENT_INSTANT2("android_webview",
+void InProcessViewRenderer::OnVisibilityChanged(bool visible) {
+ TRACE_EVENT_INSTANT1("android_webview",
"InProcessViewRenderer::OnVisibilityChanged",
TRACE_EVENT_SCOPE_THREAD,
- "view_visible",
- view_visible,
- "window_visible",
- window_visible);
- view_visible_ = window_visible && view_visible;
+ "visible",
+ visible);
+ visible_ = visible;
}
void InProcessViewRenderer::OnSizeChanged(int width, int height) {
@@ -603,7 +600,7 @@ bool InProcessViewRenderer::IsAttachedToWindow() {
}
bool InProcessViewRenderer::IsViewVisible() {
- return view_visible_;
+ return visible_;
}
gfx::Rect InProcessViewRenderer::GetScreenRect() {
diff --git a/android_webview/browser/in_process_view_renderer.h b/android_webview/browser/in_process_view_renderer.h
index db85926..673b6f3 100644
--- a/android_webview/browser/in_process_view_renderer.h
+++ b/android_webview/browser/in_process_view_renderer.h
@@ -42,8 +42,7 @@ class InProcessViewRenderer : public BrowserViewRenderer,
virtual void DrawGL(AwDrawGLInfo* draw_info) OVERRIDE;
virtual base::android::ScopedJavaLocalRef<jobject> CapturePicture() OVERRIDE;
virtual void EnableOnNewPicture(bool enabled) OVERRIDE;
- virtual void OnVisibilityChanged(
- bool view_visible, bool window_visible) OVERRIDE;
+ virtual void OnVisibilityChanged(bool visible) OVERRIDE;
virtual void OnSizeChanged(int width, int height) OVERRIDE;
virtual void ScrollTo(gfx::Vector2d new_value) OVERRIDE;
virtual void OnAttachedToWindow(int width, int height) OVERRIDE;
@@ -77,7 +76,7 @@ class InProcessViewRenderer : public BrowserViewRenderer,
content::WebContents* web_contents_;
content::SynchronousCompositor* compositor_;
- bool view_visible_;
+ bool visible_;
float dip_scale_;
// When true, we should continuously invalidate and keep drawing, for example