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

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

Issue 2945023002: Introduce profile for lock screen apps (Closed)
Patch Set: rebase Created 3 years, 5 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 | « no previous file | chrome/browser/chromeos/file_manager/volume_manager.cc » ('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 (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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 } 151 }
152 152
153 Profile* ExtractProfileFromPath(const base::FilePath& path) { 153 Profile* ExtractProfileFromPath(const base::FilePath& path) {
154 DCHECK_CURRENTLY_ON(BrowserThread::UI); 154 DCHECK_CURRENTLY_ON(BrowserThread::UI);
155 155
156 const std::vector<Profile*>& profiles = 156 const std::vector<Profile*>& profiles =
157 g_browser_process->profile_manager()->GetLoadedProfiles(); 157 g_browser_process->profile_manager()->GetLoadedProfiles();
158 for (size_t i = 0; i < profiles.size(); ++i) { 158 for (size_t i = 0; i < profiles.size(); ++i) {
159 Profile* original_profile = profiles[i]->GetOriginalProfile(); 159 Profile* original_profile = profiles[i]->GetOriginalProfile();
160 if (original_profile == profiles[i] && 160 if (original_profile == profiles[i] &&
161 !chromeos::ProfileHelper::IsSigninProfile(original_profile)) { 161 !chromeos::ProfileHelper::IsSigninProfile(original_profile) &&
162 !chromeos::ProfileHelper::IsLockScreenAppProfile(original_profile)) {
162 const base::FilePath base = GetDriveMountPointPath(original_profile); 163 const base::FilePath base = GetDriveMountPointPath(original_profile);
163 if (base == path || base.IsParent(path)) 164 if (base == path || base.IsParent(path))
164 return original_profile; 165 return original_profile;
165 } 166 }
166 } 167 }
167 return NULL; 168 return NULL;
168 } 169 }
169 170
170 base::FilePath ExtractDrivePathFromFileSystemUrl( 171 base::FilePath ExtractDrivePathFromFileSystemUrl(
171 const storage::FileSystemURL& url) { 172 const storage::FileSystemURL& url) {
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 const bool disable_sync_over_celluar = 252 const bool disable_sync_over_celluar =
252 profile->GetPrefs()->GetBoolean(prefs::kDisableDriveOverCellular); 253 profile->GetPrefs()->GetBoolean(prefs::kDisableDriveOverCellular);
253 254
254 if (is_connection_cellular && disable_sync_over_celluar) 255 if (is_connection_cellular && disable_sync_over_celluar)
255 return DRIVE_CONNECTED_METERED; 256 return DRIVE_CONNECTED_METERED;
256 return DRIVE_CONNECTED; 257 return DRIVE_CONNECTED;
257 } 258 }
258 259
259 } // namespace util 260 } // namespace util
260 } // namespace drive 261 } // namespace drive
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/file_manager/volume_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698