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

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

Issue 23549039: Preparing to support fragment resolution against non-hierarchical schemes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Spelling mistake in comment fixed Created 7 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/identity/gaia_web_auth_flow.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 <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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 std::string url(base::StringPrintf("%s:%s", 191 std::string url(base::StringPrintf("%s:%s",
192 chrome::kDriveScheme, 192 chrome::kDriveScheme,
193 path.AsUTF8Unsafe().c_str())); 193 path.AsUTF8Unsafe().c_str()));
194 return GURL(url); 194 return GURL(url);
195 } 195 }
196 196
197 base::FilePath DriveURLToFilePath(const GURL& url) { 197 base::FilePath DriveURLToFilePath(const GURL& url) {
198 if (!url.is_valid() || url.scheme() != chrome::kDriveScheme) 198 if (!url.is_valid() || url.scheme() != chrome::kDriveScheme)
199 return base::FilePath(); 199 return base::FilePath();
200 std::string path_string = net::UnescapeURLComponent( 200 std::string path_string = net::UnescapeURLComponent(
201 url.path(), net::UnescapeRule::NORMAL); 201 url.GetContent(), net::UnescapeRule::NORMAL);
202 return base::FilePath::FromUTF8Unsafe(path_string); 202 return base::FilePath::FromUTF8Unsafe(path_string);
203 } 203 }
204 204
205 void MaybeSetDriveURL(Profile* profile, const base::FilePath& path, GURL* url) { 205 void MaybeSetDriveURL(Profile* profile, const base::FilePath& path, GURL* url) {
206 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 206 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
207 207
208 if (!IsUnderDriveMountPoint(path)) 208 if (!IsUnderDriveMountPoint(path))
209 return; 209 return;
210 210
211 FileSystemInterface* file_system = GetFileSystemByProfile(profile); 211 FileSystemInterface* file_system = GetFileSystemByProfile(profile);
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 // Disable Drive if preference is set. This can happen with commandline flag 419 // Disable Drive if preference is set. This can happen with commandline flag
420 // --disable-drive or enterprise policy, or with user settings. 420 // --disable-drive or enterprise policy, or with user settings.
421 if (profile->GetPrefs()->GetBoolean(prefs::kDisableDrive)) 421 if (profile->GetPrefs()->GetBoolean(prefs::kDisableDrive))
422 return false; 422 return false;
423 423
424 return true; 424 return true;
425 } 425 }
426 426
427 } // namespace util 427 } // namespace util
428 } // namespace drive 428 } // namespace drive
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/identity/gaia_web_auth_flow.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698