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

Side by Side Diff: chrome/browser/chromeos/gdata/find_entry_delegate.h

Issue 10204013: Move FindEntryDelegate and friends to separate file. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: change tense of comments Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/find_entry_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2012 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_CHROMEOS_GDATA_FIND_ENTRY_DELEGATE_H_
6 #define CHROME_BROWSER_CHROMEOS_GDATA_FIND_ENTRY_DELEGATE_H_
7 #pragma once
8
9 #include "base/bind.h"
10 #include "base/platform_file.h"
11
12 class FilePath;
13
14 namespace gdata {
15
16 class GDataEntry;
17
18 // Used to get result of file search. Please note that |file| is a live
19 // object provided to this callback under lock. It must not be used outside
20 // of the callback method. This callback can be invoked on different thread
21 // than one that started the request.
22 typedef base::Callback<void(base::PlatformFileError error,
23 const FilePath& directory_path,
24 GDataEntry* entry)>
25 FindEntryCallback;
26
27 // Delegate class used to deal with results synchronous read-only search
28 // over virtual file system.
29 class FindEntryDelegate {
30 public:
31 virtual ~FindEntryDelegate();
32
33 // Called when FindEntryByPathSync() completes search.
34 virtual void OnDone(base::PlatformFileError error,
35 const FilePath& directory_path,
36 GDataEntry* entry) = 0;
37 };
38
39 // Delegate used to find a directory element for file system updates.
40 class ReadOnlyFindEntryDelegate : public FindEntryDelegate {
41 public:
42 ReadOnlyFindEntryDelegate();
43
44 // Returns found entry.
45 GDataEntry* entry() { return entry_; }
46
47 private:
48 // FindEntryDelegate overrides.
49 virtual void OnDone(base::PlatformFileError error,
50 const FilePath& directory_path,
51 GDataEntry* entry) OVERRIDE;
52
53 // Entry that was found.
54 GDataEntry* entry_;
55 };
56
57 // FindEntryCallbackRelayDelegate class implementation.
58 // This class is used to relay calls between sync and async versions
59 // of FindFileByPath(Sync|Async) calls.
60 class FindEntryCallbackRelayDelegate : public FindEntryDelegate {
61 public:
62 explicit FindEntryCallbackRelayDelegate(const FindEntryCallback& callback);
63 virtual ~FindEntryCallbackRelayDelegate();
64
65 private:
66 // FindEntryDelegate overrides.
67 virtual void OnDone(base::PlatformFileError error,
68 const FilePath& directory_path,
69 GDataEntry* entry) OVERRIDE;
70
71 const FindEntryCallback callback_;
72 };
73
74 } // namespace gdata
75
76 #endif // CHROME_BROWSER_CHROMEOS_GDATA_FIND_ENTRY_DELEGATE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/find_entry_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698