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

Side by Side Diff: components/drive/file_system_core_util.cc

Issue 2799603002: Process TeamDrive change in change list. (Closed)
Patch Set: Remove unnecessary return value, as the TeamDriveResource conversion always succeeds. Created 3 years, 8 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
« no previous file with comments | « components/drive/file_system_core_util.h ('k') | components/drive/resource_entry_conversion.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/drive/file_system_core_util.h" 5 #include "components/drive/file_system_core_util.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 return grand_root_path; 73 return grand_root_path;
74 } 74 }
75 75
76 const base::FilePath& GetDriveMyDriveRootPath() { 76 const base::FilePath& GetDriveMyDriveRootPath() {
77 CR_DEFINE_STATIC_LOCAL( 77 CR_DEFINE_STATIC_LOCAL(
78 base::FilePath, drive_root_path, 78 base::FilePath, drive_root_path,
79 (GetDriveGrandRootPath().AppendASCII(kDriveMyDriveRootDirName))); 79 (GetDriveGrandRootPath().AppendASCII(kDriveMyDriveRootDirName)));
80 return drive_root_path; 80 return drive_root_path;
81 } 81 }
82 82
83 const base::FilePath& GetDriveTeamDrivesRootPath() {
84 CR_DEFINE_STATIC_LOCAL(
85 base::FilePath, team_drives_root_path,
86 (GetDriveGrandRootPath().AppendASCII(kDriveTeamDrivesDirName)));
87 return team_drives_root_path;
88 }
89
83 std::string EscapeCacheFileName(const std::string& filename) { 90 std::string EscapeCacheFileName(const std::string& filename) {
84 // This is based on net/base/escape.cc: net::(anonymous namespace)::Escape 91 // This is based on net/base/escape.cc: net::(anonymous namespace)::Escape
85 std::string escaped; 92 std::string escaped;
86 for (size_t i = 0; i < filename.size(); ++i) { 93 for (size_t i = 0; i < filename.size(); ++i) {
87 char c = filename[i]; 94 char c = filename[i];
88 if (c == '%' || c == '.' || c == '/') { 95 if (c == '%' || c == '.' || c == '/') {
89 base::StringAppendF(&escaped, "%%%02X", c); 96 base::StringAppendF(&escaped, "%%%02X", c);
90 } else { 97 } else {
91 escaped.push_back(c); 98 escaped.push_back(c);
92 } 99 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 GURL ReadUrlFromGDocFile(const base::FilePath& file_path) { 143 GURL ReadUrlFromGDocFile(const base::FilePath& file_path) {
137 return GURL(ReadStringFromGDocFile(file_path, "url")); 144 return GURL(ReadStringFromGDocFile(file_path, "url"));
138 } 145 }
139 146
140 std::string ReadResourceIdFromGDocFile(const base::FilePath& file_path) { 147 std::string ReadResourceIdFromGDocFile(const base::FilePath& file_path) {
141 return ReadStringFromGDocFile(file_path, "resource_id"); 148 return ReadStringFromGDocFile(file_path, "resource_id");
142 } 149 }
143 150
144 } // namespace util 151 } // namespace util
145 } // namespace drive 152 } // namespace drive
OLDNEW
« no previous file with comments | « components/drive/file_system_core_util.h ('k') | components/drive/resource_entry_conversion.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698