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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/find_entry_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/gdata/find_entry_delegate.h
===================================================================
--- chrome/browser/chromeos/gdata/find_entry_delegate.h (revision 0)
+++ chrome/browser/chromeos/gdata/find_entry_delegate.h (revision 0)
@@ -0,0 +1,76 @@
+// Copyright (c) 2012 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 CHROME_BROWSER_CHROMEOS_GDATA_FIND_ENTRY_DELEGATE_H_
+#define CHROME_BROWSER_CHROMEOS_GDATA_FIND_ENTRY_DELEGATE_H_
+#pragma once
+
+#include "base/bind.h"
+#include "base/platform_file.h"
+
+class FilePath;
+
+namespace gdata {
+
+class GDataEntry;
+
+// Used to get result of file search. Please note that |file| is a live
+// object provided to this callback under lock. It must not be used outside
+// of the callback method. This callback can be invoked on different thread
+// than one that started the request.
+typedef base::Callback<void(base::PlatformFileError error,
+ const FilePath& directory_path,
+ GDataEntry* entry)>
+ FindEntryCallback;
+
+// Delegate class used to deal with results synchronous read-only search
+// over virtual file system.
+class FindEntryDelegate {
+ public:
+ virtual ~FindEntryDelegate();
+
+ // Called when FindEntryByPathSync() completes search.
+ virtual void OnDone(base::PlatformFileError error,
+ const FilePath& directory_path,
+ GDataEntry* entry) = 0;
+};
+
+// Delegate used to find a directory element for file system updates.
+class ReadOnlyFindEntryDelegate : public FindEntryDelegate {
+ public:
+ ReadOnlyFindEntryDelegate();
+
+ // Returns found entry.
+ GDataEntry* entry() { return entry_; }
+
+ private:
+ // FindEntryDelegate overrides.
+ virtual void OnDone(base::PlatformFileError error,
+ const FilePath& directory_path,
+ GDataEntry* entry) OVERRIDE;
+
+ // Entry that was found.
+ GDataEntry* entry_;
+};
+
+// FindEntryCallbackRelayDelegate class implementation.
+// This class is used to relay calls between sync and async versions
+// of FindFileByPath(Sync|Async) calls.
+class FindEntryCallbackRelayDelegate : public FindEntryDelegate {
+ public:
+ explicit FindEntryCallbackRelayDelegate(const FindEntryCallback& callback);
+ virtual ~FindEntryCallbackRelayDelegate();
+
+ private:
+ // FindEntryDelegate overrides.
+ virtual void OnDone(base::PlatformFileError error,
+ const FilePath& directory_path,
+ GDataEntry* entry) OVERRIDE;
+
+ const FindEntryCallback callback_;
+};
+
+} // namespace gdata
+
+#endif // CHROME_BROWSER_CHROMEOS_GDATA_FIND_ENTRY_DELEGATE_H_
Property changes on: chrome/browser/chromeos/gdata/find_entry_delegate.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« 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