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

Side by Side Diff: chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc

Issue 1165323004: We should use UserID object to identify users instead of username. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/chromeos/extensions/file_manager/private_api_drive.h" 5 #include "chrome/browser/chromeos/extensions/file_manager/private_api_drive.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after
974 role = google_apis::drive::PERMISSION_ROLE_COMMENTER; 974 role = google_apis::drive::PERMISSION_ROLE_COMMENTER;
975 break; 975 break;
976 case api::file_manager_private::DRIVE_SHARE_TYPE_CAN_VIEW: 976 case api::file_manager_private::DRIVE_SHARE_TYPE_CAN_VIEW:
977 role = google_apis::drive::PERMISSION_ROLE_READER; 977 role = google_apis::drive::PERMISSION_ROLE_READER;
978 break; 978 break;
979 } 979 }
980 980
981 // Share |drive_path| in |owner_file_system| to |user->email()|. 981 // Share |drive_path| in |owner_file_system| to |user->email()|.
982 owner_file_system->AddPermission( 982 owner_file_system->AddPermission(
983 drive_path, 983 drive_path,
984 user->email(), 984 user->GetUserID(),
985 role, 985 role,
986 base::Bind(&FileManagerPrivateRequestDriveShareFunction::OnAddPermission, 986 base::Bind(&FileManagerPrivateRequestDriveShareFunction::OnAddPermission,
987 this)); 987 this));
988 return true; 988 return true;
989 } 989 }
990 990
991 void FileManagerPrivateRequestDriveShareFunction::OnAddPermission( 991 void FileManagerPrivateRequestDriveShareFunction::OnAddPermission(
992 drive::FileError error) { 992 drive::FileError error) {
993 SendResponse(error == drive::FILE_ERROR_OK); 993 SendResponse(error == drive::FILE_ERROR_OK);
994 } 994 }
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
1077 } 1077 }
1078 1078
1079 const std::string url = 1079 const std::string url =
1080 download_url_.Resolve("?access_token=" + access_token).spec(); 1080 download_url_.Resolve("?access_token=" + access_token).spec();
1081 SetResult(new base::StringValue(url)); 1081 SetResult(new base::StringValue(url));
1082 1082
1083 SendResponse(true); 1083 SendResponse(true);
1084 } 1084 }
1085 1085
1086 } // namespace extensions 1086 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698