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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 string16(), | 76 string16(), |
77 default_path, | 77 default_path, |
78 NULL, | 78 NULL, |
79 0, | 79 0, |
80 FILE_PATH_LITERAL(""), | 80 FILE_PATH_LITERAL(""), |
81 NULL, | 81 NULL, |
82 NULL); | 82 NULL); |
83 } | 83 } |
84 | 84 |
85 // ui::SelectFileDialog::Listener implementation. | 85 // ui::SelectFileDialog::Listener implementation. |
86 virtual void FileSelected(const FilePath& path, int index, void* params) { | 86 virtual void FileSelected(const FilePath& path, |
| 87 int index, |
| 88 void* params) OVERRIDE { |
87 selected_callback_.Run(path); | 89 selected_callback_.Run(path); |
88 Release(); // Balanced in ::Show. | 90 Release(); // Balanced in ::Show. |
89 } | 91 } |
90 | 92 |
91 virtual void MultiFilesSelected(const std::vector<FilePath>& files, | 93 virtual void MultiFilesSelected(const std::vector<FilePath>& files, |
92 void* params) { | 94 void* params) OVERRIDE { |
93 Release(); // Balanced in ::Show. | 95 Release(); // Balanced in ::Show. |
94 NOTREACHED() << "Should not be able to select multiple files"; | 96 NOTREACHED() << "Should not be able to select multiple files"; |
95 } | 97 } |
96 | 98 |
97 virtual void FileSelectionCanceled(void* params) { | 99 virtual void FileSelectionCanceled(void* params) OVERRIDE { |
98 canceled_callback_.Run(); | 100 canceled_callback_.Run(); |
99 Release(); // Balanced in ::Show. | 101 Release(); // Balanced in ::Show. |
100 } | 102 } |
101 | 103 |
102 private: | 104 private: |
103 friend class base::RefCounted<SelectFileDialog>; | 105 friend class base::RefCounted<SelectFileDialog>; |
104 virtual ~SelectFileDialog() {} | 106 virtual ~SelectFileDialog() {} |
105 | 107 |
106 scoped_refptr<ui::SelectFileDialog> select_file_dialog_; | 108 scoped_refptr<ui::SelectFileDialog> select_file_dialog_; |
107 SelectedCallback selected_callback_; | 109 SelectedCallback selected_callback_; |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 void DevToolsFileHelper::RemoveFileSystem(const std::string& file_system_path) { | 392 void DevToolsFileHelper::RemoveFileSystem(const std::string& file_system_path) { |
391 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 393 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
392 FilePath path = FilePath::FromUTF8Unsafe(file_system_path); | 394 FilePath path = FilePath::FromUTF8Unsafe(file_system_path); |
393 isolated_context()->RevokeFileSystemByPath(path); | 395 isolated_context()->RevokeFileSystemByPath(path); |
394 | 396 |
395 DictionaryPrefUpdate update(profile_->GetPrefs(), | 397 DictionaryPrefUpdate update(profile_->GetPrefs(), |
396 prefs::kDevToolsFileSystemPaths); | 398 prefs::kDevToolsFileSystemPaths); |
397 DictionaryValue* file_systems_paths_value = update.Get(); | 399 DictionaryValue* file_systems_paths_value = update.Get(); |
398 file_systems_paths_value->RemoveWithoutPathExpansion(file_system_path, NULL); | 400 file_systems_paths_value->RemoveWithoutPathExpansion(file_system_path, NULL); |
399 } | 401 } |
OLD | NEW |