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

Unified Diff: chrome/browser/google_apis/gdata_contacts_requests.cc

Issue 96413002: Move c/b/google_apis to google_apis/drive. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years 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 | « chrome/browser/google_apis/gdata_contacts_requests.h ('k') | chrome/browser/google_apis/gdata_errorcode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/google_apis/gdata_contacts_requests.cc
diff --git a/chrome/browser/google_apis/gdata_contacts_requests.cc b/chrome/browser/google_apis/gdata_contacts_requests.cc
deleted file mode 100644
index 3d3e6d46c2f3d9adc2b2e52aaf717dc46ee364f1..0000000000000000000000000000000000000000
--- a/chrome/browser/google_apis/gdata_contacts_requests.cc
+++ /dev/null
@@ -1,115 +0,0 @@
-// 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.
-
-#include "chrome/browser/google_apis/gdata_contacts_requests.h"
-
-#include "chrome/browser/google_apis/time_util.h"
-#include "net/base/url_util.h"
-#include "url/gurl.h"
-
-namespace google_apis {
-
-namespace {
-
-// URL requesting all contact groups.
-const char kGetContactGroupsURL[] =
- "https://www.google.com/m8/feeds/groups/default/full?alt=json";
-
-// URL requesting all contacts.
-// TODO(derat): Per https://goo.gl/AufHP, "The feed may not contain all of the
-// user's contacts, because there's a default limit on the number of results
-// returned." Decide if 10000 is reasonable or not.
-const char kGetContactsURL[] =
- "https://www.google.com/m8/feeds/contacts/default/full"
- "?alt=json&showdeleted=true&max-results=10000";
-
-// Query parameter optionally appended to |kGetContactsURL| to return contacts
-// from a specific group (as opposed to all contacts).
-const char kGetContactsGroupParam[] = "group";
-
-// Query parameter optionally appended to |kGetContactsURL| to return only
-// recently-updated contacts.
-const char kGetContactsUpdatedMinParam[] = "updated-min";
-
-} // namespace
-
-//========================== GetContactGroupsRequest =========================
-
-GetContactGroupsRequest::GetContactGroupsRequest(
- RequestSender* runner,
- const GetDataCallback& callback)
- : GetDataRequest(runner, callback) {
-}
-
-GetContactGroupsRequest::~GetContactGroupsRequest() {}
-
-GURL GetContactGroupsRequest::GetURL() const {
- return !feed_url_for_testing_.is_empty() ?
- feed_url_for_testing_ :
- GURL(kGetContactGroupsURL);
-}
-
-//============================ GetContactsRequest ============================
-
-GetContactsRequest::GetContactsRequest(
- RequestSender* runner,
- const std::string& group_id,
- const base::Time& min_update_time,
- const GetDataCallback& callback)
- : GetDataRequest(runner, callback),
- group_id_(group_id),
- min_update_time_(min_update_time) {
-}
-
-GetContactsRequest::~GetContactsRequest() {}
-
-GURL GetContactsRequest::GetURL() const {
- if (!feed_url_for_testing_.is_empty())
- return GURL(feed_url_for_testing_);
-
- GURL url(kGetContactsURL);
-
- if (!group_id_.empty()) {
- url = net::AppendQueryParameter(url, kGetContactsGroupParam, group_id_);
- }
- if (!min_update_time_.is_null()) {
- std::string time_rfc3339 = util::FormatTimeAsString(min_update_time_);
- url = net::AppendQueryParameter(
- url, kGetContactsUpdatedMinParam, time_rfc3339);
- }
- return url;
-}
-
-//========================== GetContactPhotoRequest ==========================
-
-GetContactPhotoRequest::GetContactPhotoRequest(
- RequestSender* runner,
- const GURL& photo_url,
- const GetContentCallback& callback)
- : UrlFetchRequestBase(runner),
- photo_url_(photo_url),
- callback_(callback) {
-}
-
-GetContactPhotoRequest::~GetContactPhotoRequest() {}
-
-GURL GetContactPhotoRequest::GetURL() const {
- return photo_url_;
-}
-
-void GetContactPhotoRequest::ProcessURLFetchResults(
- const net::URLFetcher* source) {
- GDataErrorCode code = GetErrorCode();
- scoped_ptr<std::string> data(new std::string(response_writer()->data()));
- callback_.Run(code, data.Pass());
- OnProcessURLFetchResultsComplete();
-}
-
-void GetContactPhotoRequest::RunCallbackOnPrematureFailure(
- GDataErrorCode code) {
- scoped_ptr<std::string> data(new std::string);
- callback_.Run(code, data.Pass());
-}
-
-} // namespace google_apis
« no previous file with comments | « chrome/browser/google_apis/gdata_contacts_requests.h ('k') | chrome/browser/google_apis/gdata_errorcode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698