| 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" |
| 11 #include "base/android/scoped_java_ref.h" | 11 #include "base/android/scoped_java_ref.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "content/public/browser/web_contents_observer.h" | 13 #include "content/public/browser/web_contents_observer.h" |
| 14 | 14 |
| 15 namespace content{ | 15 namespace content{ |
| 16 struct WebPreferences; | 16 struct WebPreferences; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace android_webview { | 19 namespace android_webview { |
| 20 | 20 |
| 21 class AwRenderViewHostExt; | 21 class AwRenderViewHostExt; |
| 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, jlong web_contents); | 27 AwSettings(JNIEnv* env, jobject obj, content::WebContents* web_contents); |
| 28 virtual ~AwSettings(); | 28 virtual ~AwSettings(); |
| 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, jobject obj); |
| 33 void PopulateWebPreferencesLocked(JNIEnv* env, jobject obj, jlong web_prefs); | 33 void PopulateWebPreferencesLocked(JNIEnv* env, jobject obj, jlong web_prefs); |
| 34 void ResetScrollAndScaleState(JNIEnv* env, jobject obj); | 34 void ResetScrollAndScaleState(JNIEnv* env, jobject obj); |
| 35 void UpdateEverythingLocked(JNIEnv* env, jobject obj); | 35 void UpdateEverythingLocked(JNIEnv* env, jobject obj); |
| 36 void UpdateInitialPageScaleLocked(JNIEnv* env, jobject obj); | 36 void UpdateInitialPageScaleLocked(JNIEnv* env, jobject obj); |
| 37 void UpdateUserAgentLocked(JNIEnv* env, jobject obj); | 37 void UpdateUserAgentLocked(JNIEnv* env, jobject obj); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 53 bool renderer_prefs_initialized_; | 53 bool renderer_prefs_initialized_; |
| 54 | 54 |
| 55 JavaObjectWeakGlobalRef aw_settings_; | 55 JavaObjectWeakGlobalRef aw_settings_; |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 bool RegisterAwSettings(JNIEnv* env); | 58 bool RegisterAwSettings(JNIEnv* env); |
| 59 | 59 |
| 60 } // namespace android_webview | 60 } // namespace android_webview |
| 61 | 61 |
| 62 #endif // ANDROID_WEBVIEW_NATIVE_AW_SETTINGS_H_ | 62 #endif // ANDROID_WEBVIEW_NATIVE_AW_SETTINGS_H_ |
| OLD | NEW |