OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/file_system_provider/mount_path_util.h" | 5 #include "chrome/browser/chromeos/file_system_provider/mount_path_util.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 if (components[0] != FILE_PATH_LITERAL("/")) | 71 if (components[0] != FILE_PATH_LITERAL("/")) |
72 return false; | 72 return false; |
73 | 73 |
74 if (components[1] != kProvidedMountPointRoot + 1 /* no leading slash */) | 74 if (components[1] != kProvidedMountPointRoot + 1 /* no leading slash */) |
75 return false; | 75 return false; |
76 | 76 |
77 return true; | 77 return true; |
78 } | 78 } |
79 | 79 |
80 FileSystemURLParser::FileSystemURLParser(const fileapi::FileSystemURL& url) | 80 FileSystemURLParser::FileSystemURLParser(const storage::FileSystemURL& url) |
81 : url_(url), file_system_(NULL) { | 81 : url_(url), file_system_(NULL) { |
82 } | 82 } |
83 | 83 |
84 FileSystemURLParser::~FileSystemURLParser() { | 84 FileSystemURLParser::~FileSystemURLParser() { |
85 } | 85 } |
86 | 86 |
87 bool FileSystemURLParser::Parse() { | 87 bool FileSystemURLParser::Parse() { |
88 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 88 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
89 | 89 |
90 if (url_.type() != fileapi::kFileSystemTypeProvided) | 90 if (url_.type() != storage::kFileSystemTypeProvided) |
91 return false; | 91 return false; |
92 | 92 |
93 // First, find the service handling the mount point of the URL. | 93 // First, find the service handling the mount point of the URL. |
94 const std::vector<Profile*>& profiles = | 94 const std::vector<Profile*>& profiles = |
95 g_browser_process->profile_manager()->GetLoadedProfiles(); | 95 g_browser_process->profile_manager()->GetLoadedProfiles(); |
96 | 96 |
97 for (size_t i = 0; i < profiles.size(); ++i) { | 97 for (size_t i = 0; i < profiles.size(); ++i) { |
98 Profile* original_profile = profiles[i]->GetOriginalProfile(); | 98 Profile* original_profile = profiles[i]->GetOriginalProfile(); |
99 | 99 |
100 if (original_profile != profiles[i] || | 100 if (original_profile != profiles[i] || |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 for (size_t i = 3; i < components.size(); ++i) { | 170 for (size_t i = 3; i < components.size(); ++i) { |
171 file_path_ = file_path_.Append(components[i]); | 171 file_path_ = file_path_.Append(components[i]); |
172 } | 172 } |
173 | 173 |
174 return true; | 174 return true; |
175 } | 175 } |
176 | 176 |
177 } // namespace util | 177 } // namespace util |
178 } // namespace file_system_provider | 178 } // namespace file_system_provider |
179 } // namespace chromeos | 179 } // namespace chromeos |
OLD | NEW |