Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(324)

Side by Side Diff: ui/shell_dialogs/select_file_dialog_win.cc

Issue 2375663002: Replace MessageLoop::current()->task_runner() with ThreadTaskRunnerHandle::Get(). (Closed)
Patch Set: rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "ui/shell_dialogs/select_file_dialog_win.h" 5 #include "ui/shell_dialogs/select_file_dialog_win.h"
6 6
7 #include <shlobj.h> 7 #include <shlobj.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
11 #include <set> 11 #include <set>
12 #include <tuple> 12 #include <tuple>
13 13
14 #include "base/bind.h" 14 #include "base/bind.h"
15 #include "base/files/file_path.h" 15 #include "base/files/file_path.h"
16 #include "base/files/file_util.h" 16 #include "base/files/file_util.h"
17 #include "base/i18n/case_conversion.h" 17 #include "base/i18n/case_conversion.h"
18 #include "base/logging.h"
18 #include "base/macros.h" 19 #include "base/macros.h"
19 #include "base/message_loop/message_loop.h" 20 #include "base/message_loop/message_loop.h"
20 #include "base/single_thread_task_runner.h" 21 #include "base/single_thread_task_runner.h"
21 #include "base/threading/thread.h" 22 #include "base/threading/thread.h"
23 #include "base/threading/thread_task_runner_handle.h"
22 #include "base/win/registry.h" 24 #include "base/win/registry.h"
23 #include "base/win/scoped_comptr.h" 25 #include "base/win/scoped_comptr.h"
24 #include "base/win/shortcut.h" 26 #include "base/win/shortcut.h"
25 #include "ui/aura/window.h" 27 #include "ui/aura/window.h"
26 #include "ui/aura/window_event_dispatcher.h" 28 #include "ui/aura/window_event_dispatcher.h"
27 #include "ui/aura/window_tree_host.h" 29 #include "ui/aura/window_tree_host.h"
28 #include "ui/base/l10n/l10n_util.h" 30 #include "ui/base/l10n/l10n_util.h"
29 #include "ui/base/win/open_file_name_win.h" 31 #include "ui/base/win/open_file_name_win.h"
30 #include "ui/gfx/native_widget_types.h" 32 #include "ui/gfx/native_widget_types.h"
31 #include "ui/shell_dialogs/base_shell_dialog_win.h" 33 #include "ui/shell_dialogs/base_shell_dialog_win.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 const std::wstring& default_extension, 196 const std::wstring& default_extension,
195 RunState run_state, 197 RunState run_state,
196 HWND owner, 198 HWND owner,
197 void* params) 199 void* params)
198 : type(type), 200 : type(type),
199 title(title), 201 title(title),
200 default_path(default_path), 202 default_path(default_path),
201 file_type_index(file_type_index), 203 file_type_index(file_type_index),
202 default_extension(default_extension), 204 default_extension(default_extension),
203 run_state(run_state), 205 run_state(run_state),
204 ui_task_runner(base::MessageLoopForUI::current()->task_runner()), 206 ui_task_runner(base::ThreadTaskRunnerHandle::Get()),
205 owner(owner), 207 owner(owner),
206 params(params) { 208 params(params) {
209 DCHECK(base::MessageLoopForUI::IsCurrent());
207 if (file_types) 210 if (file_types)
208 this->file_types = *file_types; 211 this->file_types = *file_types;
209 } 212 }
210 SelectFileDialog::Type type; 213 SelectFileDialog::Type type;
211 std::wstring title; 214 std::wstring title;
212 base::FilePath default_path; 215 base::FilePath default_path;
213 FileTypeInfo file_types; 216 FileTypeInfo file_types;
214 int file_type_index; 217 int file_type_index;
215 std::wstring default_extension; 218 std::wstring default_extension;
216 RunState run_state; 219 RunState run_state;
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 710
708 SelectFileDialog* CreateSelectFileDialog(SelectFileDialog::Listener* listener, 711 SelectFileDialog* CreateSelectFileDialog(SelectFileDialog::Listener* listener,
709 SelectFilePolicy* policy) { 712 SelectFilePolicy* policy) {
710 return CreateWinSelectFileDialog(listener, 713 return CreateWinSelectFileDialog(listener,
711 policy, 714 policy,
712 base::Bind(&CallBuiltinGetOpenFileName), 715 base::Bind(&CallBuiltinGetOpenFileName),
713 base::Bind(&CallBuiltinGetSaveFileName)); 716 base::Bind(&CallBuiltinGetSaveFileName));
714 } 717 }
715 718
716 } // namespace ui 719 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/wayland/wayland_connection.cc ('k') | ui/views/controls/menu/menu_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698