| 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/chrome_select_file_dialog_factory_win.h" | 5 #include "chrome/browser/chrome_select_file_dialog_factory_win.h" |
| 6 | 6 |
| 7 #include <Windows.h> | 7 #include <Windows.h> |
| 8 #include <commdlg.h> | 8 #include <commdlg.h> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 // Returns the list of selected filenames. Each should be interpreted as a | 65 // Returns the list of selected filenames. Each should be interpreted as a |
| 66 // child of directory(). | 66 // child of directory(). |
| 67 const std::vector<base::FilePath>& filenames() const { return filenames_; } | 67 const std::vector<base::FilePath>& filenames() const { return filenames_; } |
| 68 | 68 |
| 69 // UtilityProcessHostClient implementation | 69 // UtilityProcessHostClient implementation |
| 70 void OnProcessCrashed(int exit_code) override; | 70 void OnProcessCrashed(int exit_code) override; |
| 71 void OnProcessLaunchFailed() override; | 71 void OnProcessLaunchFailed() override; |
| 72 bool OnMessageReceived(const IPC::Message& message) override; | 72 bool OnMessageReceived(const IPC::Message& message) override; |
| 73 | 73 |
| 74 protected: | 74 protected: |
| 75 virtual ~GetOpenFileNameClient(); | 75 ~GetOpenFileNameClient() override; |
| 76 | 76 |
| 77 private: | 77 private: |
| 78 void OnResult(const base::FilePath& directory, | 78 void OnResult(const base::FilePath& directory, |
| 79 const std::vector<base::FilePath>& filenames); | 79 const std::vector<base::FilePath>& filenames); |
| 80 void OnFailure(); | 80 void OnFailure(); |
| 81 | 81 |
| 82 base::FilePath directory_; | 82 base::FilePath directory_; |
| 83 std::vector<base::FilePath> filenames_; | 83 std::vector<base::FilePath> filenames_; |
| 84 base::WaitableEvent event_; | 84 base::WaitableEvent event_; |
| 85 | 85 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 | 198 |
| 199 // Returns the index of the user-selected filter. | 199 // Returns the index of the user-selected filter. |
| 200 int one_based_filter_index() const { return one_based_filter_index_; } | 200 int one_based_filter_index() const { return one_based_filter_index_; } |
| 201 | 201 |
| 202 // UtilityProcessHostClient implementation | 202 // UtilityProcessHostClient implementation |
| 203 void OnProcessCrashed(int exit_code) override; | 203 void OnProcessCrashed(int exit_code) override; |
| 204 void OnProcessLaunchFailed() override; | 204 void OnProcessLaunchFailed() override; |
| 205 bool OnMessageReceived(const IPC::Message& message) override; | 205 bool OnMessageReceived(const IPC::Message& message) override; |
| 206 | 206 |
| 207 protected: | 207 protected: |
| 208 virtual ~GetSaveFileNameClient(); | 208 ~GetSaveFileNameClient() override; |
| 209 | 209 |
| 210 private: | 210 private: |
| 211 void OnResult(const base::FilePath& path, int one_based_filter_index); | 211 void OnResult(const base::FilePath& path, int one_based_filter_index); |
| 212 void OnFailure(); | 212 void OnFailure(); |
| 213 | 213 |
| 214 base::FilePath path_; | 214 base::FilePath path_; |
| 215 int one_based_filter_index_; | 215 int one_based_filter_index_; |
| 216 base::WaitableEvent event_; | 216 base::WaitableEvent event_; |
| 217 | 217 |
| 218 DISALLOW_COPY_AND_ASSIGN(GetSaveFileNameClient); | 218 DISALLOW_COPY_AND_ASSIGN(GetSaveFileNameClient); |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 | 335 |
| 336 ui::SelectFileDialog* ChromeSelectFileDialogFactory::Create( | 336 ui::SelectFileDialog* ChromeSelectFileDialogFactory::Create( |
| 337 ui::SelectFileDialog::Listener* listener, | 337 ui::SelectFileDialog::Listener* listener, |
| 338 ui::SelectFilePolicy* policy) { | 338 ui::SelectFilePolicy* policy) { |
| 339 return ui::CreateWinSelectFileDialog( | 339 return ui::CreateWinSelectFileDialog( |
| 340 listener, | 340 listener, |
| 341 policy, | 341 policy, |
| 342 base::Bind(GetOpenFileNameImpl, blocking_task_runner_), | 342 base::Bind(GetOpenFileNameImpl, blocking_task_runner_), |
| 343 base::Bind(GetSaveFileNameImpl, blocking_task_runner_)); | 343 base::Bind(GetSaveFileNameImpl, blocking_task_runner_)); |
| 344 } | 344 } |
| OLD | NEW |