OLD | NEW |
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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/chromeos/drive/drive_integration_service.h" | 9 #include "chrome/browser/chromeos/drive/drive_integration_service.h" |
10 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h" | 10 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h" |
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 Profile* const owner_profile = drive::util::ExtractProfileFromPath(path); | 849 Profile* const owner_profile = drive::util::ExtractProfileFromPath(path); |
850 | 850 |
851 if (!owner_profile) | 851 if (!owner_profile) |
852 return false; | 852 return false; |
853 | 853 |
854 drive::FileSystemInterface* const owner_file_system = | 854 drive::FileSystemInterface* const owner_file_system = |
855 drive::util::GetFileSystemByProfile(owner_profile); | 855 drive::util::GetFileSystemByProfile(owner_profile); |
856 if (!owner_file_system) | 856 if (!owner_file_system) |
857 return false; | 857 return false; |
858 | 858 |
859 const chromeos::User* const user = | 859 const user_manager::User* const user = |
860 chromeos::ProfileHelper::Get()->GetUserByProfile(GetProfile()); | 860 chromeos::ProfileHelper::Get()->GetUserByProfile(GetProfile()); |
861 if (!user || !user->is_logged_in()) | 861 if (!user || !user->is_logged_in()) |
862 return false; | 862 return false; |
863 | 863 |
864 google_apis::drive::PermissionRole role = | 864 google_apis::drive::PermissionRole role = |
865 google_apis::drive::PERMISSION_ROLE_READER; | 865 google_apis::drive::PERMISSION_ROLE_READER; |
866 switch (params->share_type) { | 866 switch (params->share_type) { |
867 case api::file_browser_private::DRIVE_SHARE_TYPE_NONE: | 867 case api::file_browser_private::DRIVE_SHARE_TYPE_NONE: |
868 NOTREACHED(); | 868 NOTREACHED(); |
869 return false; | 869 return false; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
979 return; | 979 return; |
980 } | 980 } |
981 | 981 |
982 const std::string url = download_url_ + "?access_token=" + access_token; | 982 const std::string url = download_url_ + "?access_token=" + access_token; |
983 SetResult(new base::StringValue(url)); | 983 SetResult(new base::StringValue(url)); |
984 | 984 |
985 SendResponse(true); | 985 SendResponse(true); |
986 } | 986 } |
987 | 987 |
988 } // namespace extensions | 988 } // namespace extensions |
OLD | NEW |