| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_PROXY_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_WEB_CONTENTS_OBSERVER_PROXY_H_ |
| 6 #define CONTENT_BROWSER_ANDROID_WEB_CONTENTS_OBSERVER_PROXY_H_ | 6 #define CONTENT_BROWSER_ANDROID_WEB_CONTENTS_OBSERVER_PROXY_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include "base/android/jni_weak_ref.h" | 10 #include "base/android/jni_weak_ref.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/process/kill.h" | 12 #include "base/process/kill.h" |
| 13 #include "content/browser/web_contents/web_contents_impl.h" | 13 #include "content/browser/web_contents/web_contents_impl.h" |
| 14 #include "content/public/browser/reload_type.h" |
| 14 #include "content/public/browser/web_contents_observer.h" | 15 #include "content/public/browser/web_contents_observer.h" |
| 15 #include "content/public/common/frame_navigate_params.h" | 16 #include "content/public/common/frame_navigate_params.h" |
| 16 #include "url/gurl.h" | 17 #include "url/gurl.h" |
| 17 | 18 |
| 18 namespace content { | 19 namespace content { |
| 19 | 20 |
| 20 class RenderViewHost; | 21 class RenderViewHost; |
| 21 class WebContents; | 22 class WebContents; |
| 22 | 23 |
| 23 // Extends WebContentsObserver for providing a public Java API for some of the | 24 // Extends WebContentsObserver for providing a public Java API for some of the |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 const GURL& validated_url) override; | 65 const GURL& validated_url) override; |
| 65 void DocumentLoadedInFrame(RenderFrameHost* render_frame_host) override; | 66 void DocumentLoadedInFrame(RenderFrameHost* render_frame_host) override; |
| 66 void NavigationEntryCommitted( | 67 void NavigationEntryCommitted( |
| 67 const LoadCommittedDetails& load_details) override; | 68 const LoadCommittedDetails& load_details) override; |
| 68 void WebContentsDestroyed() override; | 69 void WebContentsDestroyed() override; |
| 69 void DidAttachInterstitialPage() override; | 70 void DidAttachInterstitialPage() override; |
| 70 void DidDetachInterstitialPage() override; | 71 void DidDetachInterstitialPage() override; |
| 71 void DidChangeThemeColor(SkColor color) override; | 72 void DidChangeThemeColor(SkColor color) override; |
| 72 void DidStartNavigationToPendingEntry( | 73 void DidStartNavigationToPendingEntry( |
| 73 const GURL& url, | 74 const GURL& url, |
| 74 NavigationController::ReloadType reload_type) override; | 75 ReloadType reload_type) override; |
| 75 void MediaSessionStateChanged( | 76 void MediaSessionStateChanged( |
| 76 bool is_controllable, | 77 bool is_controllable, |
| 77 bool is_suspended, | 78 bool is_suspended, |
| 78 const base::Optional<MediaMetadata>& metadata) override; | 79 const base::Optional<MediaMetadata>& metadata) override; |
| 79 void SetToBaseURLForDataURLIfNeeded(std::string* url); | 80 void SetToBaseURLForDataURLIfNeeded(std::string* url); |
| 80 | 81 |
| 81 void DidFailLoadInternal(bool is_provisional_load, | 82 void DidFailLoadInternal(bool is_provisional_load, |
| 82 bool is_main_frame, | 83 bool is_main_frame, |
| 83 int error_code, | 84 int error_code, |
| 84 const base::string16& description, | 85 const base::string16& description, |
| 85 const GURL& url, | 86 const GURL& url, |
| 86 bool was_ignored_by_handler); | 87 bool was_ignored_by_handler); |
| 87 | 88 |
| 88 base::android::ScopedJavaGlobalRef<jobject> java_observer_; | 89 base::android::ScopedJavaGlobalRef<jobject> java_observer_; |
| 89 GURL base_url_of_last_started_data_url_; | 90 GURL base_url_of_last_started_data_url_; |
| 90 | 91 |
| 91 DISALLOW_COPY_AND_ASSIGN(WebContentsObserverProxy); | 92 DISALLOW_COPY_AND_ASSIGN(WebContentsObserverProxy); |
| 92 }; | 93 }; |
| 93 | 94 |
| 94 bool RegisterWebContentsObserverProxy(JNIEnv* env); | 95 bool RegisterWebContentsObserverProxy(JNIEnv* env); |
| 95 } // namespace content | 96 } // namespace content |
| 96 | 97 |
| 97 #endif // CONTENT_BROWSER_ANDROID_WEB_CONTENTS_OBSERVER_PROXY_H_ | 98 #endif // CONTENT_BROWSER_ANDROID_WEB_CONTENTS_OBSERVER_PROXY_H_ |
| OLD | NEW |