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 "ui/base/dialogs/base_shell_dialog_win.h" | 5 #include "ui/base/dialogs/base_shell_dialog_win.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
10 | 10 |
11 namespace { | 11 namespace { |
12 | 12 |
13 // Helpers to show certain types of Windows shell dialogs in a way that doesn't | 13 // Helpers to show certain types of Windows shell dialogs in a way that doesn't |
14 // block the UI of the entire app. | 14 // block the UI of the entire app. |
15 class ShellDialogThread : public base::Thread { | 15 class ShellDialogThread : public base::Thread { |
16 public: | 16 public: |
17 ShellDialogThread() : base::Thread("Chrome_ShellDialogThread") { } | 17 ShellDialogThread() : base::Thread("Chrome_ShellDialogThread") { } |
18 ~ShellDialogThread(); | 18 ~ShellDialogThread(); |
19 | 19 |
20 protected: | 20 protected: |
21 void Init(); | 21 void Init(); |
22 | |
23 void CleanUp(); | 22 void CleanUp(); |
24 | 23 |
25 private: | 24 private: |
26 DISALLOW_COPY_AND_ASSIGN(ShellDialogThread); | 25 DISALLOW_COPY_AND_ASSIGN(ShellDialogThread); |
27 }; | 26 }; |
28 | 27 |
29 ShellDialogThread::~ShellDialogThread() { | 28 ShellDialogThread::~ShellDialogThread() { |
30 Stop(); | 29 Stop(); |
31 } | 30 } |
32 | 31 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 DCHECK(started); | 101 DCHECK(started); |
103 return thread; | 102 return thread; |
104 } | 103 } |
105 | 104 |
106 void BaseShellDialogImpl::EnableOwner(HWND owner) { | 105 void BaseShellDialogImpl::EnableOwner(HWND owner) { |
107 if (IsWindow(owner)) | 106 if (IsWindow(owner)) |
108 EnableWindow(owner, TRUE); | 107 EnableWindow(owner, TRUE); |
109 } | 108 } |
110 | 109 |
111 } // namespace ui | 110 } // namespace ui |
OLD | NEW |