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

Unified Diff: chrome/browser/google_apis/drive_api_url_generator.h

Issue 11799003: Add DriveApiUrlGenerator. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add const to the DriveApiUrlGenerator member variables. Created 7 years, 11 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: chrome/browser/google_apis/drive_api_url_generator.h
diff --git a/chrome/browser/google_apis/drive_api_url_generator.h b/chrome/browser/google_apis/drive_api_url_generator.h
new file mode 100644
index 0000000000000000000000000000000000000000..6c9b093dae8cd6c4b83012d964c079404b080843
--- /dev/null
+++ b/chrome/browser/google_apis/drive_api_url_generator.h
@@ -0,0 +1,51 @@
+// 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 CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_URL_GENERATOR_H_
+#define CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_URL_GENERATOR_H_
+
+#include <string>
+
+#include "googleurl/src/gurl.h"
+
+namespace google_apis {
+
+// This class is used to generate URLs for communicating with drive api
+// servers for production, and a local server for testing.
+class DriveApiUrlGenerator {
+ public:
+ // TODO(hidehiko): Pass server name to a constructor in order to inject
+ // server path for testing.
+ DriveApiUrlGenerator();
+ ~DriveApiUrlGenerator();
+
+ // Returns a URL to fetch "about" data.
+ GURL GetAboutUrl() const;
+
+ // Returns a URL to fetch "applist" data.
+ GURL GetApplistUrl() const;
+
+ // Returns a URL to fetch a list of changes.
+ // override_url:
+ // The base url for the fetch. If empty, the default url is used.
+ // start_changestamp:
+ // The starting point of the requesting change list, or 0 if all changes
+ // are necessary.
+ GURL GetChangelistUrl(
+ const GURL& override_url, int64 start_changestamp) const;
+
+ // Returns a URL to fetch a list of files with the given |search_string|.
+ // override_url:
+ // The base url for the fetching. If empty, the default url is used.
+ // search_string: The search query.
+ GURL GetFilelistUrl(
+ const GURL& override_url, const std::string& search_string) const;
+
+ // Returns a URL to fecth a file content.
+ GURL GetFileUrl(const std::string& file_id) const;
+};
Lei Zhang 2013/01/08 04:42:50 nit: add DISALLOW_COPY_AND_ASSIGN.
hidehiko 2013/01/08 04:53:19 It is necessary to be copy-able for this class, be
satorux1 2013/01/08 04:55:00 This class has to be copyable. You might want to a
hidehiko 2013/01/08 05:19:28 Done.
+
+} // namespace google_apis
+
+#endif // CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_URL_GENERATOR_H_
« no previous file with comments | « chrome/browser/google_apis/drive_api_operations.cc ('k') | chrome/browser/google_apis/drive_api_url_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698