Chromium Code Reviews| 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_ |