| 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 #ifndef CONTENT_BROWSER_ANDROID_WEB_CONTENTS_OBSERVER_ANDROID_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_WEB_CONTENTS_OBSERVER_ANDROID_H_ | 
| 6 #define CONTENT_BROWSER_ANDROID_WEB_CONTENTS_OBSERVER_ANDROID_H_ | 6 #define CONTENT_BROWSER_ANDROID_WEB_CONTENTS_OBSERVER_ANDROID_H_ | 
| 7 | 7 | 
| 8 #include <jni.h> | 8 #include <jni.h> | 
| 9 | 9 | 
| 10 #include "base/android/jni_helper.h" | 10 #include "base/android/jni_helper.h" | 
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" | 
|  | 12 #include "base/process/kill.h" | 
| 12 #include "content/browser/web_contents/web_contents_impl.h" | 13 #include "content/browser/web_contents/web_contents_impl.h" | 
| 13 #include "content/public/browser/web_contents_observer.h" | 14 #include "content/public/browser/web_contents_observer.h" | 
| 14 #include "content/public/common/frame_navigate_params.h" | 15 #include "content/public/common/frame_navigate_params.h" | 
| 15 #include "url/gurl.h" | 16 #include "url/gurl.h" | 
| 16 | 17 | 
| 17 namespace content { | 18 namespace content { | 
| 18 | 19 | 
| 19 class RenderViewHost; | 20 class RenderViewHost; | 
| 20 class WebContents; | 21 class WebContents; | 
| 21 | 22 | 
| 22 // Extends WebContentsObserver for providing a public Java API for some of the | 23 // Extends WebContentsObserver for providing a public Java API for some of the | 
| 23 // the calls it receives. | 24 // the calls it receives. | 
| 24 class WebContentsObserverAndroid : public WebContentsObserver { | 25 class WebContentsObserverAndroid : public WebContentsObserver { | 
| 25  public: | 26  public: | 
| 26   WebContentsObserverAndroid(JNIEnv* env, | 27   WebContentsObserverAndroid(JNIEnv* env, | 
| 27                              jobject obj, | 28                              jobject obj, | 
| 28                              WebContents* web_contents); | 29                              WebContents* web_contents); | 
| 29   virtual ~WebContentsObserverAndroid(); | 30   virtual ~WebContentsObserverAndroid(); | 
| 30 | 31 | 
| 31   void Destroy(JNIEnv* env, jobject obj); | 32   void Destroy(JNIEnv* env, jobject obj); | 
| 32 | 33 | 
| 33  private: | 34  private: | 
|  | 35   virtual void RenderProcessGone( | 
|  | 36       base::TerminationStatus termination_status) OVERRIDE; | 
| 34   virtual void DidStartLoading(RenderViewHost* render_view_host) OVERRIDE; | 37   virtual void DidStartLoading(RenderViewHost* render_view_host) OVERRIDE; | 
| 35   virtual void DidStopLoading(RenderViewHost* render_view_host) OVERRIDE; | 38   virtual void DidStopLoading(RenderViewHost* render_view_host) OVERRIDE; | 
| 36   virtual void DidFailProvisionalLoad( | 39   virtual void DidFailProvisionalLoad( | 
| 37       int64 frame_id, | 40       int64 frame_id, | 
| 38       const string16& frame_unique_name, | 41       const string16& frame_unique_name, | 
| 39       bool is_main_frame, | 42       bool is_main_frame, | 
| 40       const GURL& validated_url, | 43       const GURL& validated_url, | 
| 41       int error_code, | 44       int error_code, | 
| 42       const string16& error_description, | 45       const string16& error_description, | 
| 43       RenderViewHost* render_view_host) OVERRIDE; | 46       RenderViewHost* render_view_host) OVERRIDE; | 
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 85 | 88 | 
| 86   JavaObjectWeakGlobalRef weak_java_observer_; | 89   JavaObjectWeakGlobalRef weak_java_observer_; | 
| 87 | 90 | 
| 88   DISALLOW_COPY_AND_ASSIGN(WebContentsObserverAndroid); | 91   DISALLOW_COPY_AND_ASSIGN(WebContentsObserverAndroid); | 
| 89 }; | 92 }; | 
| 90 | 93 | 
| 91 bool RegisterWebContentsObserverAndroid(JNIEnv* env); | 94 bool RegisterWebContentsObserverAndroid(JNIEnv* env); | 
| 92 }  // namespace content | 95 }  // namespace content | 
| 93 | 96 | 
| 94 #endif  // CONTENT_BROWSER_ANDROID_WEB_CONTENTS_OBSERVER_ANDROID_H_ | 97 #endif  // CONTENT_BROWSER_ANDROID_WEB_CONTENTS_OBSERVER_ANDROID_H_ | 
| OLD | NEW | 
|---|