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

Side by Side Diff: chrome/browser/ui/cocoa/find_pasteboard.h

Issue 7149013: Remove most of the remaining test dependencies (other than chrome/test). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_COCOA_FIND_PASTEBOARD_H_
6 #define CHROME_BROWSER_UI_COCOA_FIND_PASTEBOARD_H_
7 #pragma once
8
9 #include "base/string16.h"
10
11 #ifdef __OBJC__
12
13 #import <Cocoa/Cocoa.h>
14
15 #include "base/memory/scoped_nsobject.h"
16
17 extern NSString* kFindPasteboardChangedNotification;
18
19 // Manages the find pasteboard. Use this to copy text to the find pasteboard,
20 // to get the text currently on the find pasteboard, and to receive
21 // notifications when the text on the find pasteboard has changed. You should
22 // always use this class instead of accessing
23 // [NSPasteboard pasteboardWithName:NSFindPboard] directly.
24 //
25 // This is not thread-safe and must be used on the main thread.
26 //
27 // This is supposed to be a singleton.
28 @interface FindPasteboard : NSObject {
29 @private
30 scoped_nsobject<NSString> findText_;
31 }
32
33 // Returns the singleton instance of this class.
34 + (FindPasteboard*)sharedInstance;
35
36 // Returns the current find text. This is never nil; if there is no text on the
37 // find pasteboard, this returns an empty string.
38 - (NSString*)findText;
39
40 // Sets the current find text to |newText| and sends a
41 // |kFindPasteboardChangedNotification| to the default notification center if
42 // it the new text different from the current text. |newText| must not be nil.
43 - (void)setFindText:(NSString*)newText;
44 @end
45
46 @interface FindPasteboard (TestingAPI)
47 - (void)loadTextFromPasteboard:(NSNotification*)notification;
48
49 // This methods is meant to be overridden in tests.
50 - (NSPasteboard*)findPboard;
51 @end
52
53 #endif // __OBJC__
54
55 // Also provide a c++ interface
56 string16 GetFindPboardText();
57
58 #endif // CHROME_BROWSER_UI_COCOA_FIND_PASTEBOARD_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller_unittest.mm ('k') | chrome/browser/ui/cocoa/find_pasteboard.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698