| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/debugger/devtools_file_util.h" | 5 #include "chrome/browser/debugger/devtools_file_util.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| 11 #include "chrome/browser/download/download_prefs.h" | 11 #include "chrome/browser/download/download_prefs.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/ui/shell_dialogs.h" | 13 #include "chrome/browser/ui/shell_dialogs.h" |
| 14 | 14 |
| 15 using content::BrowserThread; |
| 16 |
| 15 namespace { | 17 namespace { |
| 16 | 18 |
| 17 class SaveAsDialog : public SelectFileDialog::Listener, | 19 class SaveAsDialog : public SelectFileDialog::Listener, |
| 18 public base::RefCounted<SaveAsDialog> { | 20 public base::RefCounted<SaveAsDialog> { |
| 19 public: | 21 public: |
| 20 SaveAsDialog() { | 22 SaveAsDialog() { |
| 21 select_file_dialog_ = SelectFileDialog::Create(this); | 23 select_file_dialog_ = SelectFileDialog::Create(this); |
| 22 } | 24 } |
| 23 | 25 |
| 24 void Show(Profile* profile, | 26 void Show(Profile* profile, |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 97 |
| 96 } // namespace | 98 } // namespace |
| 97 | 99 |
| 98 // static | 100 // static |
| 99 void DevToolsFileUtil::SaveAs(Profile* profile, | 101 void DevToolsFileUtil::SaveAs(Profile* profile, |
| 100 const std::string& suggested_file_name, | 102 const std::string& suggested_file_name, |
| 101 const std::string& content) { | 103 const std::string& content) { |
| 102 scoped_refptr<SaveAsDialog> dialog = new SaveAsDialog(); | 104 scoped_refptr<SaveAsDialog> dialog = new SaveAsDialog(); |
| 103 dialog->Show(profile, suggested_file_name, content); | 105 dialog->Show(profile, suggested_file_name, content); |
| 104 } | 106 } |
| OLD | NEW |