OLD | NEW |
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/devtools/devtools_file_helper.h" | 5 #include "chrome/browser/devtools/devtools_file_helper.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 } | 311 } |
312 std::string registered_name; | 312 std::string registered_name; |
313 std::string file_system_id = RegisterFileSystem(web_contents_, | 313 std::string file_system_id = RegisterFileSystem(web_contents_, |
314 path, | 314 path, |
315 ®istered_name); | 315 ®istered_name); |
316 std::string file_system_path = path.AsUTF8Unsafe(); | 316 std::string file_system_path = path.AsUTF8Unsafe(); |
317 | 317 |
318 DictionaryPrefUpdate update(profile_->GetPrefs(), | 318 DictionaryPrefUpdate update(profile_->GetPrefs(), |
319 prefs::kDevToolsFileSystemPaths); | 319 prefs::kDevToolsFileSystemPaths); |
320 DictionaryValue* file_systems_paths_value = update.Get(); | 320 DictionaryValue* file_systems_paths_value = update.Get(); |
321 file_systems_paths_value->Set(file_system_path, Value::CreateNullValue()); | 321 file_systems_paths_value->SetWithoutPathExpansion(file_system_path, |
| 322 Value::CreateNullValue()); |
322 | 323 |
323 FileSystem filesystem = CreateFileSystemStruct(web_contents_, | 324 FileSystem filesystem = CreateFileSystemStruct(web_contents_, |
324 file_system_id, | 325 file_system_id, |
325 registered_name, | 326 registered_name, |
326 file_system_path); | 327 file_system_path); |
327 callback.Run(filesystem); | 328 callback.Run(filesystem); |
328 } | 329 } |
329 | 330 |
330 void DevToolsFileHelper::RequestFileSystems( | 331 void DevToolsFileHelper::RequestFileSystems( |
331 const RequestFileSystemsCallback& callback) { | 332 const RequestFileSystemsCallback& callback) { |
(...skipping 21 matching lines...) Expand all Loading... |
353 void DevToolsFileHelper::RemoveFileSystem(const std::string& file_system_path) { | 354 void DevToolsFileHelper::RemoveFileSystem(const std::string& file_system_path) { |
354 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 355 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
355 base::FilePath path = base::FilePath::FromUTF8Unsafe(file_system_path); | 356 base::FilePath path = base::FilePath::FromUTF8Unsafe(file_system_path); |
356 isolated_context()->RevokeFileSystemByPath(path); | 357 isolated_context()->RevokeFileSystemByPath(path); |
357 | 358 |
358 DictionaryPrefUpdate update(profile_->GetPrefs(), | 359 DictionaryPrefUpdate update(profile_->GetPrefs(), |
359 prefs::kDevToolsFileSystemPaths); | 360 prefs::kDevToolsFileSystemPaths); |
360 DictionaryValue* file_systems_paths_value = update.Get(); | 361 DictionaryValue* file_systems_paths_value = update.Get(); |
361 file_systems_paths_value->RemoveWithoutPathExpansion(file_system_path, NULL); | 362 file_systems_paths_value->RemoveWithoutPathExpansion(file_system_path, NULL); |
362 } | 363 } |
OLD | NEW |