forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaw_settings.h
81 lines (63 loc) · 2.56 KB
/
aw_settings.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ANDROID_WEBVIEW_NATIVE_AW_SETTINGS_H_
#define ANDROID_WEBVIEW_NATIVE_AW_SETTINGS_H_
#include <jni.h>
#include <memory>
#include "base/android/jni_weak_ref.h"
#include "base/android/scoped_java_ref.h"
#include "content/public/browser/web_contents_observer.h"
namespace content{
struct WebPreferences;
}
namespace android_webview {
class AwRenderViewHostExt;
class AwSettings : public content::WebContentsObserver {
public:
static AwSettings* FromWebContents(content::WebContents* web_contents);
AwSettings(JNIEnv* env, jobject obj, content::WebContents* web_contents);
~AwSettings() override;
// Called from Java. Methods with "Locked" suffix require that the settings
// access lock is held during their execution.
void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
void PopulateWebPreferencesLocked(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj,
jlong web_prefs);
void ResetScrollAndScaleState(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj);
void UpdateEverythingLocked(JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj);
void UpdateInitialPageScaleLocked(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj);
void UpdateUserAgentLocked(JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj);
void UpdateWebkitPreferencesLocked(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj);
void UpdateFormDataPreferencesLocked(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj);
void UpdateRendererPreferencesLocked(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj);
void UpdateOffscreenPreRasterLocked(
JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj);
void PopulateWebPreferences(content::WebPreferences* web_prefs);
private:
AwRenderViewHostExt* GetAwRenderViewHostExt();
void UpdateEverything();
// WebContentsObserver overrides:
void RenderViewHostChanged(content::RenderViewHost* old_host,
content::RenderViewHost* new_host) override;
void WebContentsDestroyed() override;
bool renderer_prefs_initialized_;
JavaObjectWeakGlobalRef aw_settings_;
};
bool RegisterAwSettings(JNIEnv* env);
} // namespace android_webview
#endif // ANDROID_WEBVIEW_NATIVE_AW_SETTINGS_H_