| 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/ui/shell_dialogs.h" | 5 #include "chrome/browser/ui/shell_dialogs.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <commdlg.h> | 8 #include <commdlg.h> |
| 9 #include <shlobj.h> | 9 #include <shlobj.h> |
| 10 | 10 |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 } | 376 } |
| 377 | 377 |
| 378 } // namespace | 378 } // namespace |
| 379 | 379 |
| 380 // Helpers to show certain types of Windows shell dialogs in a way that doesn't | 380 // Helpers to show certain types of Windows shell dialogs in a way that doesn't |
| 381 // block the UI of the entire app. | 381 // block the UI of the entire app. |
| 382 | 382 |
| 383 class ShellDialogThread : public base::Thread { | 383 class ShellDialogThread : public base::Thread { |
| 384 public: | 384 public: |
| 385 ShellDialogThread() : base::Thread("Chrome_ShellDialogThread") { } | 385 ShellDialogThread() : base::Thread("Chrome_ShellDialogThread") { } |
| 386 ~ShellDialogThread() { |
| 387 Stop(); |
| 388 } |
| 386 | 389 |
| 387 protected: | 390 protected: |
| 388 void Init() { | 391 void Init() { |
| 389 // Initializes the COM library on the current thread. | 392 // Initializes the COM library on the current thread. |
| 390 CoInitialize(NULL); | 393 CoInitialize(NULL); |
| 391 } | 394 } |
| 392 | 395 |
| 393 void CleanUp() { | 396 void CleanUp() { |
| 394 // Closes the COM library on the current thread. CoInitialize must | 397 // Closes the COM library on the current thread. CoInitialize must |
| 395 // be balanced by a corresponding call to CoUninitialize. | 398 // be balanced by a corresponding call to CoUninitialize. |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 951 } | 954 } |
| 952 } | 955 } |
| 953 } | 956 } |
| 954 return success; | 957 return success; |
| 955 } | 958 } |
| 956 | 959 |
| 957 // static | 960 // static |
| 958 SelectFileDialog* SelectFileDialog::Create(Listener* listener) { | 961 SelectFileDialog* SelectFileDialog::Create(Listener* listener) { |
| 959 return new SelectFileDialogImpl(listener); | 962 return new SelectFileDialogImpl(listener); |
| 960 } | 963 } |
| OLD | NEW |