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

Side by Side Diff: android_webview/browser/browser_view_renderer.h

Issue 1377593003: Refactor BrowserViewRenderer to support page visibility (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: refactor again Created 5 years, 2 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #ifndef ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ 5 #ifndef ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_
6 #define ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ 6 #define ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_
7 7
8 #include "android_webview/browser/parent_compositor_draw_constraints.h" 8 #include "android_webview/browser/parent_compositor_draw_constraints.h"
9 #include "android_webview/browser/shared_renderer_state.h" 9 #include "android_webview/browser/shared_renderer_state.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 void ScrollTo(gfx::Vector2d new_value); 86 void ScrollTo(gfx::Vector2d new_value);
87 87
88 // Android views hierarchy gluing. 88 // Android views hierarchy gluing.
89 bool IsVisible() const; 89 bool IsVisible() const;
90 gfx::Rect GetScreenRect() const; 90 gfx::Rect GetScreenRect() const;
91 bool attached_to_window() const { return attached_to_window_; } 91 bool attached_to_window() const { return attached_to_window_; }
92 bool hardware_enabled() const { return hardware_enabled_; } 92 bool hardware_enabled() const { return hardware_enabled_; }
93 gfx::Size size() const { return size_; } 93 gfx::Size size() const { return size_; }
94 void ReleaseHardware(); 94 void ReleaseHardware();
95 95
96 bool IsClientVisible() const;
96 void TrimMemory(const int level, const bool visible); 97 void TrimMemory(const int level, const bool visible);
97 98
98 // SynchronousCompositorClient overrides. 99 // SynchronousCompositorClient overrides.
99 void DidInitializeCompositor( 100 void DidInitializeCompositor(
100 content::SynchronousCompositor* compositor) override; 101 content::SynchronousCompositor* compositor) override;
101 void DidDestroyCompositor( 102 void DidDestroyCompositor(
102 content::SynchronousCompositor* compositor) override; 103 content::SynchronousCompositor* compositor) override;
103 void PostInvalidate() override; 104 void PostInvalidate() override;
104 void DidUpdateContent() override; 105 void DidUpdateContent() override;
105 void UpdateRootLayerState(const gfx::Vector2dF& total_scroll_offset_dip, 106 void UpdateRootLayerState(const gfx::Vector2dF& total_scroll_offset_dip,
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 bool clear_view_; 173 bool clear_view_;
173 174
174 bool offscreen_pre_raster_; 175 bool offscreen_pre_raster_;
175 176
176 gfx::Vector2d last_on_draw_scroll_offset_; 177 gfx::Vector2d last_on_draw_scroll_offset_;
177 gfx::Rect last_on_draw_global_visible_rect_; 178 gfx::Rect last_on_draw_global_visible_rect_;
178 179
179 base::CancelableClosure post_fallback_tick_; 180 base::CancelableClosure post_fallback_tick_;
180 base::CancelableClosure fallback_tick_fired_; 181 base::CancelableClosure fallback_tick_fired_;
181 bool fallback_tick_pending_; 182 bool fallback_tick_pending_;
183 bool disable_page_visibility_;
182 184
183 gfx::Size size_; 185 gfx::Size size_;
184 186
185 gfx::SizeF scrollable_size_dip_; 187 gfx::SizeF scrollable_size_dip_;
186 188
187 // Current scroll offset in CSS pixels. 189 // Current scroll offset in CSS pixels.
188 // TODO(miletus): Make scroll_offset_dip_ a gfx::ScrollOffset. 190 // TODO(miletus): Make scroll_offset_dip_ a gfx::ScrollOffset.
189 gfx::Vector2dF scroll_offset_dip_; 191 gfx::Vector2dF scroll_offset_dip_;
190 192
191 // Max scroll offset in CSS pixels. 193 // Max scroll offset in CSS pixels.
192 // TODO(miletus): Make max_scroll_offset_dip_ a gfx::ScrollOffset. 194 // TODO(miletus): Make max_scroll_offset_dip_ a gfx::ScrollOffset.
193 gfx::Vector2dF max_scroll_offset_dip_; 195 gfx::Vector2dF max_scroll_offset_dip_;
194 196
195 // Used to prevent rounding errors from accumulating enough to generate 197 // Used to prevent rounding errors from accumulating enough to generate
196 // visible skew (especially noticeable when scrolling up and down in the same 198 // visible skew (especially noticeable when scrolling up and down in the same
197 // spot over a period of time). 199 // spot over a period of time).
198 // TODO(miletus): Make overscroll_rounding_error_ a gfx::ScrollOffset. 200 // TODO(miletus): Make overscroll_rounding_error_ a gfx::ScrollOffset.
199 gfx::Vector2dF overscroll_rounding_error_; 201 gfx::Vector2dF overscroll_rounding_error_;
200 202
201 DISALLOW_COPY_AND_ASSIGN(BrowserViewRenderer); 203 DISALLOW_COPY_AND_ASSIGN(BrowserViewRenderer);
202 }; 204 };
203 205
204 } // namespace android_webview 206 } // namespace android_webview
205 207
206 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ 208 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_
OLDNEW
« no previous file with comments | « no previous file | android_webview/browser/browser_view_renderer.cc » ('j') | android_webview/browser/browser_view_renderer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698