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

Unified Diff: content/public/test/clipboard_write_observer.h

Issue 12041078: Clear the clipboard closing Incognito window (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Selection clipboard support Created 7 years, 10 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
Index: content/public/test/clipboard_write_observer.h
diff --git a/content/public/test/clipboard_write_observer.h b/content/public/test/clipboard_write_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..6a56be635b5e5e2bb9e02f7877adb6365494cde5
--- /dev/null
+++ b/content/public/test/clipboard_write_observer.h
@@ -0,0 +1,38 @@
+// 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 CONTENT_PUBLIC_TEST_CLIPBOARD_WRITE_OBSERVER_H_
+#define CONTENT_PUBLIC_TEST_CLIPBOARD_WRITE_OBSERVER_H_
+
+#include "base/basictypes.h"
+#include "ui/base/clipboard/clipboard.h"
+
+namespace content {
+
+class MessageLoopRunner;
+
+// ClipboardWriteObserver allows user to wait until Clipboard::WriteObjects has
+// finished.
+class ClipboardWriteObserver :
jam 2013/02/11 21:28:53 i try to keep the number of files in content/publi
vasilii 2013/02/12 15:58:32 I don't understand how callback can help me. This
vasilii 2013/02/12 17:25:18 Please note that the current OnWriteObjects() not
vasilii 2013/02/13 16:57:26 Done.
+ public ui::Clipboard::ClipboardObserverForTesting {
+ public:
+ explicit ClipboardWriteObserver(ui::Clipboard* clipboard,
dcheng 2013/02/11 22:58:21 explicit is only required for single-argument ctor
vasilii 2013/02/12 15:58:32 Done.
+ ui::Clipboard::Buffer buffer);
+ virtual ~ClipboardWriteObserver();
+
+ void Wait();
+ private:
+ virtual void OnWriteObjects(ui::Clipboard::Buffer buffer) OVERRIDE;
+
+ bool seen_;
+ bool running_;
+ ui::Clipboard::Buffer buffer_;
+ scoped_refptr<MessageLoopRunner> message_loop_runner_;
+ ui::Clipboard* clipboard_;
+
+ DISALLOW_COPY_AND_ASSIGN(ClipboardWriteObserver);
+};
+
+} // namespace content
+#endif // CONTENT_PUBLIC_TEST_CLIPBOARD_WRITE_OBSERVER_H_

Powered by Google App Engine
This is Rietveld 408576698