Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1573)

Unified Diff: ui/base/clipboard/clipboard_android.h

Issue 2832263002: Clipboard Android - Store and Read Last Modified Time from Prefs (Closed)
Patch Set: final comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/pref_names.cc ('k') | ui/base/clipboard/clipboard_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..716cc387f741db078e3cc35a9ee2d7c823d1fc47 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.
+ using ModifiedCallback = base::Callback<void(base::Time)>;
+
// 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(ModifiedCallback cb);
+
+ // Sets the last modified time without calling the above callback.
+ UI_BASE_EXPORT void SetLastModifiedTimeWithoutRunningCallback(
+ base::Time time);
+
private:
friend class Clipboard;
« no previous file with comments | « chrome/common/pref_names.cc ('k') | ui/base/clipboard/clipboard_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698