OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 UI_BASE_CLIPBOARD_CLIPBOARD_ANDROID_H_ | 5 #ifndef UI_BASE_CLIPBOARD_CLIPBOARD_ANDROID_H_ |
6 #define UI_BASE_CLIPBOARD_CLIPBOARD_ANDROID_H_ | 6 #define UI_BASE_CLIPBOARD_CLIPBOARD_ANDROID_H_ |
7 | 7 |
8 #include "ui/base/clipboard/clipboard.h" | 8 #include "ui/base/clipboard/clipboard.h" |
9 | 9 |
10 #include <jni.h> | 10 #include <jni.h> |
11 #include <stddef.h> | 11 #include <stddef.h> |
12 #include <stdint.h> | 12 #include <stdint.h> |
13 | 13 |
14 #include "base/android/scoped_java_ref.h" | 14 #include "base/android/scoped_java_ref.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
17 | 17 |
| 18 class PrefService; |
| 19 class PrefRegistrySimple; |
| 20 |
18 namespace ui { | 21 namespace ui { |
19 | 22 |
20 class ClipboardAndroid : public Clipboard { | 23 class ClipboardAndroid : public Clipboard { |
21 public: | 24 public: |
| 25 UI_BASE_EXPORT static void RegisterPrefs(PrefRegistrySimple* registry); |
| 26 |
| 27 // Called during startup when local state is available to store a pointer to |
| 28 // |local_state| in order to read and update prefs. Local state is a |
| 29 // place to store data locally independent of a particular profile; it |
| 30 // uses the PrefService interface. |
| 31 UI_BASE_EXPORT void SetLocalState(PrefService* local_state); |
| 32 |
22 // Called by Java when the Java Clipboard is notified that the clipboard has | 33 // Called by Java when the Java Clipboard is notified that the clipboard has |
23 // changed. | 34 // changed. |
24 void OnPrimaryClipChanged(JNIEnv* env, | 35 void OnPrimaryClipChanged(JNIEnv* env, |
25 const base::android::JavaParamRef<jobject>& obj); | 36 const base::android::JavaParamRef<jobject>& obj); |
26 | 37 |
27 private: | 38 private: |
28 friend class Clipboard; | 39 friend class Clipboard; |
29 | 40 |
30 ClipboardAndroid(); | 41 ClipboardAndroid(); |
31 ~ClipboardAndroid() override; | 42 ~ClipboardAndroid() override; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 85 |
75 DISALLOW_COPY_AND_ASSIGN(ClipboardAndroid); | 86 DISALLOW_COPY_AND_ASSIGN(ClipboardAndroid); |
76 }; | 87 }; |
77 | 88 |
78 // Registers the ClipboardAndroid native method. | 89 // Registers the ClipboardAndroid native method. |
79 bool RegisterClipboardAndroid(JNIEnv* env); | 90 bool RegisterClipboardAndroid(JNIEnv* env); |
80 | 91 |
81 } // namespace ui | 92 } // namespace ui |
82 | 93 |
83 #endif // UI_BASE_CLIPBOARD_CLIPBOARD_ANDROID_H_ | 94 #endif // UI_BASE_CLIPBOARD_CLIPBOARD_ANDROID_H_ |
OLD | NEW |