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" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/lazy_instance.h" | 12 #include "base/lazy_instance.h" |
13 #include "base/md5.h" | 13 #include "base/md5.h" |
14 #include "base/value_conversions.h" | 14 #include "base/value_conversions.h" |
15 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
16 #include "chrome/browser/download/download_prefs.h" | 16 #include "chrome/browser/download/download_prefs.h" |
17 #include "chrome/browser/prefs/pref_service.h" | 17 #include "chrome/browser/prefs/pref_service.h" |
18 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 18 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
20 #include "chrome/browser/ui/chrome_select_file_policy.h" | 20 #include "chrome/browser/ui/chrome_select_file_policy.h" |
21 #include "chrome/common/pref_names.h" | 21 #include "chrome/common/pref_names.h" |
22 #include "content/public/browser/browser_context.h" | 22 #include "content/public/browser/browser_context.h" |
| 23 #include "content/public/browser/browser_thread.h" |
23 #include "content/public/browser/download_manager.h" | 24 #include "content/public/browser/download_manager.h" |
24 #include "ui/base/dialogs/select_file_dialog.h" | 25 #include "ui/base/dialogs/select_file_dialog.h" |
25 | 26 |
26 using base::Bind; | 27 using base::Bind; |
27 using base::Callback; | 28 using base::Callback; |
28 using content::BrowserContext; | 29 using content::BrowserContext; |
29 using content::BrowserThread; | 30 using content::BrowserThread; |
30 using content::DownloadManager; | 31 using content::DownloadManager; |
31 | 32 |
32 namespace { | 33 namespace { |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 DictionaryValue* files_map = update.Get(); | 186 DictionaryValue* files_map = update.Get(); |
186 files_map->SetWithoutPathExpansion(base::MD5String(url), | 187 files_map->SetWithoutPathExpansion(base::MD5String(url), |
187 base::CreateFilePathValue(path)); | 188 base::CreateFilePathValue(path)); |
188 callback.Run(); | 189 callback.Run(); |
189 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 190 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
190 base::Bind(&WriteToFile, path, content)); | 191 base::Bind(&WriteToFile, path, content)); |
191 } | 192 } |
192 | 193 |
193 void DevToolsFileHelper::SaveAsFileSelectionCanceled() { | 194 void DevToolsFileHelper::SaveAsFileSelectionCanceled() { |
194 } | 195 } |
OLD | NEW |