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

Side by Side Diff: content/browser/android/content_view_core_impl.h

Issue 14268004: Add overscroll edge effect animations for Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 8 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 #ifndef CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ 5 #ifndef CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_
6 #define CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ 6 #define CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/android/jni_helper.h" 10 #include "base/android/jni_helper.h"
(...skipping 11 matching lines...) Expand all
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
23 #include "ui/gfx/rect.h" 23 #include "ui/gfx/rect.h"
24 24
25 struct WebMenuItem; 25 struct WebMenuItem;
26 26
27 namespace ui { 27 namespace ui {
28 class WindowAndroid; 28 class WindowAndroid;
29 } 29 }
30 30
31 namespace content { 31 namespace content {
32 class OverscrollGlow;
32 class RenderWidgetHostViewAndroid; 33 class RenderWidgetHostViewAndroid;
33 class SyncInputEventFilter; 34 class SyncInputEventFilter;
34 35
35 // TODO(jrg): this is a shell. Upstream the rest. 36 // TODO(jrg): this is a shell. Upstream the rest.
36 class ContentViewCoreImpl : public ContentViewCore, 37 class ContentViewCoreImpl : public ContentViewCore,
37 public NotificationObserver { 38 public NotificationObserver {
38 public: 39 public:
39 static ContentViewCoreImpl* FromWebContents(WebContents* web_contents); 40 static ContentViewCoreImpl* FromWebContents(WebContents* web_contents);
40 ContentViewCoreImpl(JNIEnv* env, 41 ContentViewCoreImpl(JNIEnv* env,
41 jobject obj, 42 jobject obj,
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 jobject obj, 163 jobject obj,
163 jstring script, 164 jstring script,
164 jobject callback); 165 jobject callback);
165 int GetNativeImeAdapter(JNIEnv* env, jobject obj); 166 int GetNativeImeAdapter(JNIEnv* env, jobject obj);
166 void SetFocus(JNIEnv* env, jobject obj, jboolean focused); 167 void SetFocus(JNIEnv* env, jobject obj, jboolean focused);
167 void ScrollFocusedEditableNodeIntoView(JNIEnv* env, jobject obj); 168 void ScrollFocusedEditableNodeIntoView(JNIEnv* env, jobject obj);
168 void UndoScrollFocusedEditableNodeIntoView(JNIEnv* env, jobject obj); 169 void UndoScrollFocusedEditableNodeIntoView(JNIEnv* env, jobject obj);
169 170
170 jint GetBackgroundColor(JNIEnv* env, jobject obj); 171 jint GetBackgroundColor(JNIEnv* env, jobject obj);
171 void SetBackgroundColor(JNIEnv* env, jobject obj, jint color); 172 void SetBackgroundColor(JNIEnv* env, jobject obj, jint color);
173 void SetOverscrollResources(JNIEnv* env,
174 jobject obj,
175 jobject jedge_bitmap,
176 jobject jglow_bitmap);
172 void OnShow(JNIEnv* env, jobject obj); 177 void OnShow(JNIEnv* env, jobject obj);
173 void OnHide(JNIEnv* env, jobject obj); 178 void OnHide(JNIEnv* env, jobject obj);
174 void ClearSslPreferences(JNIEnv* env, jobject /* obj */); 179 void ClearSslPreferences(JNIEnv* env, jobject /* obj */);
175 void SetUseDesktopUserAgent(JNIEnv* env, 180 void SetUseDesktopUserAgent(JNIEnv* env,
176 jobject /* obj */, 181 jobject /* obj */,
177 jboolean state, 182 jboolean state,
178 jboolean reload_on_state_change); 183 jboolean reload_on_state_change);
179 bool GetUseDesktopUserAgent(JNIEnv* env, jobject /* obj */); 184 bool GetUseDesktopUserAgent(JNIEnv* env, jobject /* obj */);
180 void Show(); 185 void Show();
181 void Hide(); 186 void Hide();
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 gfx::Size GetViewportSizeDip() const; 284 gfx::Size GetViewportSizeDip() const;
280 gfx::Size GetViewportSizeOffsetDip() const; 285 gfx::Size GetViewportSizeOffsetDip() const;
281 float GetOverdrawBottomHeightDip() const; 286 float GetOverdrawBottomHeightDip() const;
282 287
283 InputEventAckState FilterInputEvent(const WebKit::WebInputEvent& input_event); 288 InputEventAckState FilterInputEvent(const WebKit::WebInputEvent& input_event);
284 289
285 void AttachLayer(scoped_refptr<cc::Layer> layer); 290 void AttachLayer(scoped_refptr<cc::Layer> layer);
286 void RemoveLayer(scoped_refptr<cc::Layer> layer); 291 void RemoveLayer(scoped_refptr<cc::Layer> layer);
287 void DidProduceRendererFrame(); 292 void DidProduceRendererFrame();
288 293
294 const SkBitmap& get_overscroll_edge() const { return overscroll_edge_; }
295 const SkBitmap& get_overscroll_glow() const { return overscroll_glow_; }
296
289 private: 297 private:
290 class ContentViewUserData; 298 class ContentViewUserData;
291 299
292 friend class ContentViewUserData; 300 friend class ContentViewUserData;
293 virtual ~ContentViewCoreImpl(); 301 virtual ~ContentViewCoreImpl();
294 302
295 // NotificationObserver implementation. 303 // NotificationObserver implementation.
296 virtual void Observe(int type, 304 virtual void Observe(int type,
297 const NotificationSource& source, 305 const NotificationSource& source,
298 const NotificationDetails& details) OVERRIDE; 306 const NotificationDetails& details) OVERRIDE;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 float dpi_scale_; 354 float dpi_scale_;
347 355
348 // The owning window that has a hold of main application activity. 356 // The owning window that has a hold of main application activity.
349 ui::WindowAndroid* window_android_; 357 ui::WindowAndroid* window_android_;
350 358
351 std::vector<UpdateFrameInfoCallback> update_frame_info_callbacks_; 359 std::vector<UpdateFrameInfoCallback> update_frame_info_callbacks_;
352 360
353 // Optional browser-side input event filtering. 361 // Optional browser-side input event filtering.
354 scoped_ptr<SyncInputEventFilter> input_event_filter_; 362 scoped_ptr<SyncInputEventFilter> input_event_filter_;
355 363
364 SkBitmap overscroll_edge_;
365 SkBitmap overscroll_glow_;
366
356 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); 367 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl);
357 }; 368 };
358 369
359 bool RegisterContentViewCore(JNIEnv* env); 370 bool RegisterContentViewCore(JNIEnv* env);
360 371
361 } // namespace content 372 } // namespace content
362 373
363 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ 374 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698