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

Side by Side Diff: chrome/browser/chromeos/drive/file_system_util.cc

Issue 118953003: drive: Stop setting dummy resource ID for "drive" and "other" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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/chromeos/drive/file_system_util.h" 5 #include "chrome/browser/chromeos/drive/file_system_util.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 } 159 }
160 160
161 DriveServiceInterface* GetDriveServiceByProfile(Profile* profile) { 161 DriveServiceInterface* GetDriveServiceByProfile(Profile* profile) {
162 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 162 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
163 163
164 DriveIntegrationService* integration_service = 164 DriveIntegrationService* integration_service =
165 GetIntegrationServiceByProfile(profile); 165 GetIntegrationServiceByProfile(profile);
166 return integration_service ? integration_service->drive_service() : NULL; 166 return integration_service ? integration_service->drive_service() : NULL;
167 } 167 }
168 168
169 bool IsSpecialResourceId(const std::string& resource_id) {
170 return resource_id == kDriveGrandRootLocalId ||
171 resource_id == kDriveOtherDirLocalId;
172 }
173
174 ResourceEntry CreateMyDriveRootEntry(const std::string& root_resource_id) { 169 ResourceEntry CreateMyDriveRootEntry(const std::string& root_resource_id) {
175 ResourceEntry mydrive_root; 170 ResourceEntry mydrive_root;
176 mydrive_root.mutable_file_info()->set_is_directory(true); 171 mydrive_root.mutable_file_info()->set_is_directory(true);
177 mydrive_root.set_resource_id(root_resource_id); 172 mydrive_root.set_resource_id(root_resource_id);
178 mydrive_root.set_parent_local_id(util::kDriveGrandRootLocalId); 173 mydrive_root.set_parent_local_id(util::kDriveGrandRootLocalId);
179 mydrive_root.set_title(util::kDriveMyDriveRootDirName); 174 mydrive_root.set_title(util::kDriveMyDriveRootDirName);
180 return mydrive_root; 175 return mydrive_root;
181 } 176 }
182 177
183 const std::string& GetDriveMountPointPathAsString() { 178 const std::string& GetDriveMountPointPathAsString() {
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 const bool disable_sync_over_celluar = 401 const bool disable_sync_over_celluar =
407 profile->GetPrefs()->GetBoolean(prefs::kDisableDriveOverCellular); 402 profile->GetPrefs()->GetBoolean(prefs::kDisableDriveOverCellular);
408 403
409 if (is_connection_cellular && disable_sync_over_celluar) 404 if (is_connection_cellular && disable_sync_over_celluar)
410 return DRIVE_CONNECTED_METERED; 405 return DRIVE_CONNECTED_METERED;
411 return DRIVE_CONNECTED; 406 return DRIVE_CONNECTED;
412 } 407 }
413 408
414 } // namespace util 409 } // namespace util
415 } // namespace drive 410 } // namespace drive
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/drive/file_system_util.h ('k') | chrome/browser/chromeos/drive/file_system_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698