Remove implicit conversions from scoped_refptr to T* in content/browser/service_worker
[chromium-blink-merge.git] / content / browser / android / web_contents_observer_android.h
blob8834a3df8741ce29493cfd2855626161dde0fd5b
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_ANDROID_WEB_CONTENTS_OBSERVER_ANDROID_H_
6 #define CONTENT_BROWSER_ANDROID_WEB_CONTENTS_OBSERVER_ANDROID_H_
8 #include <jni.h>
10 #include "base/android/jni_weak_ref.h"
11 #include "base/basictypes.h"
12 #include "base/process/kill.h"
13 #include "content/browser/web_contents/web_contents_impl.h"
14 #include "content/public/browser/web_contents_observer.h"
15 #include "content/public/common/frame_navigate_params.h"
16 #include "url/gurl.h"
18 namespace content {
20 class RenderViewHost;
21 class WebContents;
23 // Extends WebContentsObserver for providing a public Java API for some of the
24 // the calls it receives.
25 class WebContentsObserverAndroid : public WebContentsObserver {
26 public:
27 WebContentsObserverAndroid(JNIEnv* env,
28 jobject obj,
29 WebContents* web_contents);
30 virtual ~WebContentsObserverAndroid();
32 void Destroy(JNIEnv* env, jobject obj);
34 private:
35 virtual void RenderProcessGone(
36 base::TerminationStatus termination_status) OVERRIDE;
37 virtual void DidStartLoading(RenderViewHost* render_view_host) OVERRIDE;
38 virtual void DidStopLoading(RenderViewHost* render_view_host) OVERRIDE;
39 virtual void DidFailProvisionalLoad(
40 RenderFrameHost* render_frame_host,
41 const GURL& validated_url,
42 int error_code,
43 const base::string16& error_description) OVERRIDE;
44 virtual void DidFailLoad(RenderFrameHost* render_frame_host,
45 const GURL& validated_url,
46 int error_code,
47 const base::string16& error_description) OVERRIDE;
48 virtual void DidNavigateMainFrame(const LoadCommittedDetails& details,
49 const FrameNavigateParams& params) OVERRIDE;
50 virtual void DidNavigateAnyFrame(const LoadCommittedDetails& details,
51 const FrameNavigateParams& params) OVERRIDE;
52 virtual void DidFirstVisuallyNonEmptyPaint() OVERRIDE;
53 virtual void DidStartProvisionalLoadForFrame(
54 RenderFrameHost* render_frame_host,
55 const GURL& validated_url,
56 bool is_error_page,
57 bool is_iframe_srcdoc) OVERRIDE;
58 virtual void DidCommitProvisionalLoadForFrame(
59 RenderFrameHost* render_frame_host,
60 const GURL& url,
61 PageTransition transition_type) OVERRIDE;
62 virtual void DidFinishLoad(RenderFrameHost* render_frame_host,
63 const GURL& validated_url) OVERRIDE;
64 virtual void DocumentLoadedInFrame(
65 RenderFrameHost* render_frame_host) OVERRIDE;
66 virtual void NavigationEntryCommitted(
67 const LoadCommittedDetails& load_details) OVERRIDE;
68 virtual void WebContentsDestroyed() OVERRIDE;
69 virtual void DidAttachInterstitialPage() OVERRIDE;
70 virtual void DidDetachInterstitialPage() OVERRIDE;
71 virtual void DidChangeThemeColor(SkColor color) OVERRIDE;
73 void DidFailLoadInternal(bool is_provisional_load,
74 bool is_main_frame,
75 int error_code,
76 const base::string16& description,
77 const GURL& url);
79 JavaObjectWeakGlobalRef weak_java_observer_;
81 DISALLOW_COPY_AND_ASSIGN(WebContentsObserverAndroid);
84 bool RegisterWebContentsObserverAndroid(JNIEnv* env);
85 } // namespace content
87 #endif // CONTENT_BROWSER_ANDROID_WEB_CONTENTS_OBSERVER_ANDROID_H_