OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 ANDROID_WEBVIEW_NATIVE_AW_SETTINGS_H_ | 5 #ifndef ANDROID_WEBVIEW_NATIVE_AW_SETTINGS_H_ |
6 #define ANDROID_WEBVIEW_NATIVE_AW_SETTINGS_H_ | 6 #define ANDROID_WEBVIEW_NATIVE_AW_SETTINGS_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" |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 class AwSettings : public content::WebContentsObserver { | 23 class AwSettings : public content::WebContentsObserver { |
24 public: | 24 public: |
25 static AwSettings* FromWebContents(content::WebContents* web_contents); | 25 static AwSettings* FromWebContents(content::WebContents* web_contents); |
26 | 26 |
27 AwSettings(JNIEnv* env, jobject obj, content::WebContents* web_contents); | 27 AwSettings(JNIEnv* env, jobject obj, content::WebContents* web_contents); |
28 ~AwSettings() override; | 28 ~AwSettings() override; |
29 | 29 |
30 // Called from Java. Methods with "Locked" suffix require that the settings | 30 // Called from Java. Methods with "Locked" suffix require that the settings |
31 // access lock is held during their execution. | 31 // access lock is held during their execution. |
32 void Destroy(JNIEnv* env, jobject obj); | 32 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
33 void PopulateWebPreferencesLocked(JNIEnv* env, jobject obj, jlong web_prefs); | 33 void PopulateWebPreferencesLocked( |
34 void ResetScrollAndScaleState(JNIEnv* env, jobject obj); | 34 JNIEnv* env, |
35 void UpdateEverythingLocked(JNIEnv* env, jobject obj); | 35 const base::android::JavaParamRef<jobject>& obj, |
36 void UpdateInitialPageScaleLocked(JNIEnv* env, jobject obj); | 36 jlong web_prefs); |
37 void UpdateUserAgentLocked(JNIEnv* env, jobject obj); | 37 void ResetScrollAndScaleState( |
38 void UpdateWebkitPreferencesLocked(JNIEnv* env, jobject obj); | 38 JNIEnv* env, |
39 void UpdateFormDataPreferencesLocked(JNIEnv* env, jobject obj); | 39 const base::android::JavaParamRef<jobject>& obj); |
40 void UpdateRendererPreferencesLocked(JNIEnv* env, jobject obj); | 40 void UpdateEverythingLocked(JNIEnv* env, |
41 void UpdateOffscreenPreRasterLocked(JNIEnv* env, jobject obj); | 41 const base::android::JavaParamRef<jobject>& obj); |
| 42 void UpdateInitialPageScaleLocked( |
| 43 JNIEnv* env, |
| 44 const base::android::JavaParamRef<jobject>& obj); |
| 45 void UpdateUserAgentLocked(JNIEnv* env, |
| 46 const base::android::JavaParamRef<jobject>& obj); |
| 47 void UpdateWebkitPreferencesLocked( |
| 48 JNIEnv* env, |
| 49 const base::android::JavaParamRef<jobject>& obj); |
| 50 void UpdateFormDataPreferencesLocked( |
| 51 JNIEnv* env, |
| 52 const base::android::JavaParamRef<jobject>& obj); |
| 53 void UpdateRendererPreferencesLocked( |
| 54 JNIEnv* env, |
| 55 const base::android::JavaParamRef<jobject>& obj); |
| 56 void UpdateOffscreenPreRasterLocked( |
| 57 JNIEnv* env, |
| 58 const base::android::JavaParamRef<jobject>& obj); |
42 | 59 |
43 void PopulateWebPreferences(content::WebPreferences* web_prefs); | 60 void PopulateWebPreferences(content::WebPreferences* web_prefs); |
44 | 61 |
45 private: | 62 private: |
46 AwRenderViewHostExt* GetAwRenderViewHostExt(); | 63 AwRenderViewHostExt* GetAwRenderViewHostExt(); |
47 void UpdateEverything(); | 64 void UpdateEverything(); |
48 | 65 |
49 // WebContentsObserver overrides: | 66 // WebContentsObserver overrides: |
50 void RenderViewCreated(content::RenderViewHost* render_view_host) override; | 67 void RenderViewCreated(content::RenderViewHost* render_view_host) override; |
51 void WebContentsDestroyed() override; | 68 void WebContentsDestroyed() override; |
52 | 69 |
53 bool renderer_prefs_initialized_; | 70 bool renderer_prefs_initialized_; |
54 | 71 |
55 JavaObjectWeakGlobalRef aw_settings_; | 72 JavaObjectWeakGlobalRef aw_settings_; |
56 }; | 73 }; |
57 | 74 |
58 bool RegisterAwSettings(JNIEnv* env); | 75 bool RegisterAwSettings(JNIEnv* env); |
59 | 76 |
60 } // namespace android_webview | 77 } // namespace android_webview |
61 | 78 |
62 #endif // ANDROID_WEBVIEW_NATIVE_AW_SETTINGS_H_ | 79 #endif // ANDROID_WEBVIEW_NATIVE_AW_SETTINGS_H_ |
OLD | NEW |