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

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

Issue 2528823002: Separate SwipeRefreshHandler and ContentViewCore (Closed)
Patch Set: Move web_contents_view_android.h header in web_contents_android.h into cc file, modify CreateRefres… Created 4 years 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/android/jni_android.h" 13 #include "base/android/jni_android.h"
14 #include "base/android/jni_weak_ref.h" 14 #include "base/android/jni_weak_ref.h"
15 #include "base/android/scoped_java_ref.h" 15 #include "base/android/scoped_java_ref.h"
16 #include "base/compiler_specific.h" 16 #include "base/compiler_specific.h"
17 #include "base/i18n/rtl.h" 17 #include "base/i18n/rtl.h"
18 #include "base/macros.h" 18 #include "base/macros.h"
19 #include "base/process/process.h" 19 #include "base/process/process.h"
20 #include "content/browser/android/content_view_core_impl_observer.h" 20 #include "content/browser/android/content_view_core_impl_observer.h"
21 #include "content/browser/renderer_host/render_widget_host_view_android.h" 21 #include "content/browser/renderer_host/render_widget_host_view_android.h"
22 #include "content/browser/web_contents/web_contents_impl.h" 22 #include "content/browser/web_contents/web_contents_impl.h"
23 #include "content/public/browser/android/content_view_core.h" 23 #include "content/public/browser/android/content_view_core.h"
24 #include "content/public/browser/web_contents_observer.h" 24 #include "content/public/browser/web_contents_observer.h"
25 #include "third_party/WebKit/public/platform/WebInputEvent.h" 25 #include "third_party/WebKit/public/platform/WebInputEvent.h"
26 #include "ui/android/overscroll_refresh.h"
27 #include "ui/android/view_android.h" 26 #include "ui/android/view_android.h"
28 #include "ui/gfx/geometry/rect.h" 27 #include "ui/gfx/geometry/rect.h"
29 #include "ui/gfx/geometry/rect_f.h" 28 #include "ui/gfx/geometry/rect_f.h"
30 #include "ui/gfx/selection_bound.h" 29 #include "ui/gfx/selection_bound.h"
31 #include "url/gurl.h" 30 #include "url/gurl.h"
32 31
33 namespace ui { 32 namespace ui {
34 class WindowAndroid; 33 class WindowAndroid;
35 } 34 }
36 35
37 namespace content { 36 namespace content {
38 37
39 class GinJavaBridgeDispatcherHost; 38 class GinJavaBridgeDispatcherHost;
40 class RenderFrameHost; 39 class RenderFrameHost;
41 class RenderWidgetHostViewAndroid; 40 class RenderWidgetHostViewAndroid;
42 struct MenuItem; 41 struct MenuItem;
43 42
44 class ContentViewCoreImpl : public ContentViewCore, 43 class ContentViewCoreImpl : public ContentViewCore,
45 public ui::OverscrollRefreshHandler,
46 public WebContentsObserver { 44 public WebContentsObserver {
47 public: 45 public:
48 static ContentViewCoreImpl* FromWebContents(WebContents* web_contents); 46 static ContentViewCoreImpl* FromWebContents(WebContents* web_contents);
49 ContentViewCoreImpl( 47 ContentViewCoreImpl(
50 JNIEnv* env, 48 JNIEnv* env,
51 const base::android::JavaRef<jobject>& obj, 49 const base::android::JavaRef<jobject>& obj,
52 WebContents* web_contents, 50 WebContents* web_contents,
53 float dpi_scale, 51 float dpi_scale,
54 const base::android::JavaRef<jobject>& java_bridge_retained_object_set); 52 const base::android::JavaRef<jobject>& java_bridge_retained_object_set);
55 53
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 397
400 friend class ContentViewUserData; 398 friend class ContentViewUserData;
401 ~ContentViewCoreImpl() override; 399 ~ContentViewCoreImpl() override;
402 400
403 // WebContentsObserver implementation. 401 // WebContentsObserver implementation.
404 void RenderViewReady() override; 402 void RenderViewReady() override;
405 void RenderViewHostChanged(RenderViewHost* old_host, 403 void RenderViewHostChanged(RenderViewHost* old_host,
406 RenderViewHost* new_host) override; 404 RenderViewHost* new_host) override;
407 void WebContentsDestroyed() override; 405 void WebContentsDestroyed() override;
408 406
409 // OverscrollRefreshHandler implementation.
410 bool PullStart() override;
411 void PullUpdate(float delta) override;
412 void PullRelease(bool allow_refresh) override;
413 void PullReset() override;
414
415 // -------------------------------------------------------------------------- 407 // --------------------------------------------------------------------------
416 // Other private methods and data 408 // Other private methods and data
417 // -------------------------------------------------------------------------- 409 // --------------------------------------------------------------------------
418 410
419 void InitWebContents(); 411 void InitWebContents();
420 void SendScreenRectsAndResizeWidget(); 412 void SendScreenRectsAndResizeWidget();
421 413
422 RenderWidgetHostViewAndroid* GetRenderWidgetHostViewAndroid() const; 414 RenderWidgetHostViewAndroid* GetRenderWidgetHostViewAndroid() const;
423 415
424 blink::WebGestureEvent MakeGestureEvent(blink::WebInputEvent::Type type, 416 blink::WebGestureEvent MakeGestureEvent(blink::WebInputEvent::Type type,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 scoped_refptr<GinJavaBridgeDispatcherHost> java_bridge_dispatcher_host_; 461 scoped_refptr<GinJavaBridgeDispatcherHost> java_bridge_dispatcher_host_;
470 462
471 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl); 463 DISALLOW_COPY_AND_ASSIGN(ContentViewCoreImpl);
472 }; 464 };
473 465
474 bool RegisterContentViewCore(JNIEnv* env); 466 bool RegisterContentViewCore(JNIEnv* env);
475 467
476 } // namespace content 468 } // namespace content
477 469
478 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_ 470 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_CORE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698