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

Side by Side Diff: chrome/browser/drive/drive_api_service.cc

Issue 449763002: Remove DriveServiceInterface::RenameResource (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/drive/drive_api_service.h" 5 #include "chrome/browser/drive/drive_api_service.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 if (!last_viewed_by_me.is_null()) { 507 if (!last_viewed_by_me.is_null()) {
508 // Need to set updateViewedDate to false, otherwise the lastViewedByMeDate 508 // Need to set updateViewedDate to false, otherwise the lastViewedByMeDate
509 // will be set to the request time (not the specified time via request). 509 // will be set to the request time (not the specified time via request).
510 request->set_update_viewed_date(false); 510 request->set_update_viewed_date(false);
511 request->set_last_viewed_by_me_date(last_viewed_by_me); 511 request->set_last_viewed_by_me_date(last_viewed_by_me);
512 } 512 }
513 request->set_fields(kFileResourceFields); 513 request->set_fields(kFileResourceFields);
514 return sender_->StartRequestWithRetry(request); 514 return sender_->StartRequestWithRetry(request);
515 } 515 }
516 516
517 CancelCallback DriveAPIService::RenameResource(
518 const std::string& resource_id,
519 const std::string& new_title,
520 const EntryActionCallback& callback) {
521 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
522 DCHECK(!callback.is_null());
523
524 FilesPatchRequest* request = new FilesPatchRequest(
525 sender_.get(), url_generator_,
526 base::Bind(&EntryActionCallbackAdapter, callback));
527 request->set_file_id(resource_id);
528 request->set_title(new_title);
529 request->set_fields(kFileResourceFields);
530 return sender_->StartRequestWithRetry(request);
531 }
532
533 CancelCallback DriveAPIService::AddResourceToDirectory( 517 CancelCallback DriveAPIService::AddResourceToDirectory(
534 const std::string& parent_resource_id, 518 const std::string& parent_resource_id,
535 const std::string& resource_id, 519 const std::string& resource_id,
536 const EntryActionCallback& callback) { 520 const EntryActionCallback& callback) {
537 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 521 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
538 DCHECK(!callback.is_null()); 522 DCHECK(!callback.is_null());
539 523
540 ChildrenInsertRequest* request = 524 ChildrenInsertRequest* request =
541 new ChildrenInsertRequest(sender_.get(), url_generator_, callback); 525 new ChildrenInsertRequest(sender_.get(), url_generator_, callback);
542 request->set_folder_id(parent_resource_id); 526 request->set_folder_id(parent_resource_id);
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 if (CanSendRequest()) { 730 if (CanSendRequest()) {
747 FOR_EACH_OBSERVER( 731 FOR_EACH_OBSERVER(
748 DriveServiceObserver, observers_, OnReadyToSendRequests()); 732 DriveServiceObserver, observers_, OnReadyToSendRequests());
749 } else if (!HasRefreshToken()) { 733 } else if (!HasRefreshToken()) {
750 FOR_EACH_OBSERVER( 734 FOR_EACH_OBSERVER(
751 DriveServiceObserver, observers_, OnRefreshTokenInvalid()); 735 DriveServiceObserver, observers_, OnRefreshTokenInvalid());
752 } 736 }
753 } 737 }
754 738
755 } // namespace drive 739 } // namespace drive
OLDNEW
« no previous file with comments | « chrome/browser/drive/drive_api_service.h ('k') | chrome/browser/drive/drive_service_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698