Chromium Code Reviews| Index: ui/base/clipboard/clipboard_android.h |
| diff --git a/ui/base/clipboard/clipboard_android.h b/ui/base/clipboard/clipboard_android.h |
| index 8589e9c75587b2936c5ae3c27c9b2dd40b0e7cf7..42acbc4d4929d8d833601945d69281c5f806abb4 100644 |
| --- a/ui/base/clipboard/clipboard_android.h |
| +++ b/ui/base/clipboard/clipboard_android.h |
| @@ -12,6 +12,7 @@ |
| #include <stdint.h> |
| #include "base/android/scoped_java_ref.h" |
| +#include "base/callback_forward.h" |
| #include "base/macros.h" |
| #include "base/time/time.h" |
| @@ -19,11 +20,22 @@ namespace ui { |
| class ClipboardAndroid : public Clipboard { |
| public: |
| + // Callback called whenever the clipboard is modified. The parameter |
| + // represents the time of the modification. |
| + typedef base::Callback<void(base::Time)> Modified; |
|
Bernhard Bauer
2017/04/27 09:27:17
Nit: ModifiedCallback? Or just inline the type; it
dcheng
2017/04/27 15:25:39
Nit 2: prefer using A = B; over typedef B A;
Mark P
2017/04/27 19:25:59
Sounds good to me. Done.
|
| + |
| // Called by Java when the Java Clipboard is notified that the clipboard has |
| // changed. |
| void OnPrimaryClipChanged(JNIEnv* env, |
| const base::android::JavaParamRef<jobject>& obj); |
| + // Sets the callback called whenever the clipboard is modified. |
| + UI_BASE_EXPORT void SetModifiedCallback(Modified cb); |
| + |
| + // Sets the last modified time without calling the above callback. |
| + UI_BASE_EXPORT void SetLastModifiedTimeWithoutRunningCallback( |
| + base::Time time); |
| + |
| private: |
| friend class Clipboard; |