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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 void WaitForCompletion(); | 58 void WaitForCompletion(); |
59 | 59 |
60 // Returns the selected directory. | 60 // Returns the selected directory. |
61 const base::FilePath& directory() const { return directory_; } | 61 const base::FilePath& directory() const { return directory_; } |
62 | 62 |
63 // Returns the list of selected filenames. Each should be interpreted as a | 63 // Returns the list of selected filenames. Each should be interpreted as a |
64 // child of directory(). | 64 // child of directory(). |
65 const std::vector<base::FilePath>& filenames() const { return filenames_; } | 65 const std::vector<base::FilePath>& filenames() const { return filenames_; } |
66 | 66 |
67 // UtilityProcessHostClient implementation | 67 // UtilityProcessHostClient implementation |
68 virtual void OnProcessCrashed(int exit_code) OVERRIDE; | 68 virtual void OnProcessCrashed(int exit_code) override; |
69 virtual void OnProcessLaunchFailed() OVERRIDE; | 69 virtual void OnProcessLaunchFailed() override; |
70 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 70 virtual bool OnMessageReceived(const IPC::Message& message) override; |
71 | 71 |
72 protected: | 72 protected: |
73 virtual ~GetOpenFileNameClient(); | 73 virtual ~GetOpenFileNameClient(); |
74 | 74 |
75 private: | 75 private: |
76 void OnResult(const base::FilePath& directory, | 76 void OnResult(const base::FilePath& directory, |
77 const std::vector<base::FilePath>& filenames); | 77 const std::vector<base::FilePath>& filenames); |
78 void OnFailure(); | 78 void OnFailure(); |
79 | 79 |
80 base::FilePath directory_; | 80 base::FilePath directory_; |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 // launch or a crash of the utility process). | 189 // launch or a crash of the utility process). |
190 void WaitForCompletion(); | 190 void WaitForCompletion(); |
191 | 191 |
192 // Returns the selected path. | 192 // Returns the selected path. |
193 const base::FilePath& path() const { return path_; } | 193 const base::FilePath& path() const { return path_; } |
194 | 194 |
195 // Returns the index of the user-selected filter. | 195 // Returns the index of the user-selected filter. |
196 int one_based_filter_index() const { return one_based_filter_index_; } | 196 int one_based_filter_index() const { return one_based_filter_index_; } |
197 | 197 |
198 // UtilityProcessHostClient implementation | 198 // UtilityProcessHostClient implementation |
199 virtual void OnProcessCrashed(int exit_code) OVERRIDE; | 199 virtual void OnProcessCrashed(int exit_code) override; |
200 virtual void OnProcessLaunchFailed() OVERRIDE; | 200 virtual void OnProcessLaunchFailed() override; |
201 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 201 virtual bool OnMessageReceived(const IPC::Message& message) override; |
202 | 202 |
203 protected: | 203 protected: |
204 virtual ~GetSaveFileNameClient(); | 204 virtual ~GetSaveFileNameClient(); |
205 | 205 |
206 private: | 206 private: |
207 void OnResult(const base::FilePath& path, int one_based_filter_index); | 207 void OnResult(const base::FilePath& path, int one_based_filter_index); |
208 void OnFailure(); | 208 void OnFailure(); |
209 | 209 |
210 base::FilePath path_; | 210 base::FilePath path_; |
211 int one_based_filter_index_; | 211 int one_based_filter_index_; |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 | 329 |
330 ui::SelectFileDialog* ChromeSelectFileDialogFactory::Create( | 330 ui::SelectFileDialog* ChromeSelectFileDialogFactory::Create( |
331 ui::SelectFileDialog::Listener* listener, | 331 ui::SelectFileDialog::Listener* listener, |
332 ui::SelectFilePolicy* policy) { | 332 ui::SelectFilePolicy* policy) { |
333 return ui::CreateWinSelectFileDialog( | 333 return ui::CreateWinSelectFileDialog( |
334 listener, | 334 listener, |
335 policy, | 335 policy, |
336 base::Bind(GetOpenFileNameImpl, blocking_task_runner_), | 336 base::Bind(GetOpenFileNameImpl, blocking_task_runner_), |
337 base::Bind(GetSaveFileNameImpl, blocking_task_runner_)); | 337 base::Bind(GetSaveFileNameImpl, blocking_task_runner_)); |
338 } | 338 } |
OLD | NEW |