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 "chrome/browser/ui/select_file_dialog.h" | 5 #include "chrome/browser/ui/select_file_dialog.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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 final_name); | 427 final_name); |
428 } | 428 } |
429 | 429 |
430 } // namespace | 430 } // namespace |
431 | 431 |
432 // Implementation of SelectFileDialog that shows a Windows common dialog for | 432 // Implementation of SelectFileDialog that shows a Windows common dialog for |
433 // choosing a file or folder. | 433 // choosing a file or folder. |
434 class SelectFileDialogImpl : public SelectFileDialog, | 434 class SelectFileDialogImpl : public SelectFileDialog, |
435 public BaseShellDialogImpl { | 435 public BaseShellDialogImpl { |
436 public: | 436 public: |
437 explicit SelectFileDialogImpl(Listener* listener); | 437 explicit SelectFileDialogImpl(Listener* listener, |
| 438 ui::SelectFilePolicy* policy); |
438 | 439 |
439 // BaseShellDialog implementation: | 440 // BaseShellDialog implementation: |
440 virtual bool IsRunning(HWND owning_hwnd) const OVERRIDE; | 441 virtual bool IsRunning(HWND owning_hwnd) const OVERRIDE; |
441 virtual void ListenerDestroyed() OVERRIDE; | 442 virtual void ListenerDestroyed() OVERRIDE; |
442 | 443 |
443 protected: | 444 protected: |
444 // SelectFileDialog implementation: | 445 // SelectFileDialog implementation: |
445 virtual void SelectFileImpl(Type type, | 446 virtual void SelectFileImpl(Type type, |
446 const string16& title, | 447 const string16& title, |
447 const FilePath& default_path, | 448 const FilePath& default_path, |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 LPARAM data); | 536 LPARAM data); |
536 | 537 |
537 virtual bool HasMultipleFileTypeChoicesImpl() OVERRIDE; | 538 virtual bool HasMultipleFileTypeChoicesImpl() OVERRIDE; |
538 | 539 |
539 bool has_multiple_file_type_choices_; | 540 bool has_multiple_file_type_choices_; |
540 | 541 |
541 | 542 |
542 DISALLOW_COPY_AND_ASSIGN(SelectFileDialogImpl); | 543 DISALLOW_COPY_AND_ASSIGN(SelectFileDialogImpl); |
543 }; | 544 }; |
544 | 545 |
545 SelectFileDialogImpl::SelectFileDialogImpl(Listener* listener) | 546 SelectFileDialogImpl::SelectFileDialogImpl(Listener* listener, |
546 : SelectFileDialog(listener), | 547 ui::SelectFilePolicy* policy) |
| 548 : SelectFileDialog(listener, policy), |
547 BaseShellDialogImpl(), | 549 BaseShellDialogImpl(), |
548 has_multiple_file_type_choices_(false) { | 550 has_multiple_file_type_choices_(false) { |
549 } | 551 } |
550 | 552 |
551 SelectFileDialogImpl::~SelectFileDialogImpl() { | 553 SelectFileDialogImpl::~SelectFileDialogImpl() { |
552 } | 554 } |
553 | 555 |
554 void SelectFileDialogImpl::SelectFileImpl( | 556 void SelectFileDialogImpl::SelectFileImpl( |
555 Type type, | 557 Type type, |
556 const string16& title, | 558 const string16& title, |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 for (std::vector<FilePath>::iterator file = path + 1; | 845 for (std::vector<FilePath>::iterator file = path + 1; |
844 file != files.end(); ++file) { | 846 file != files.end(); ++file) { |
845 paths->push_back(path->Append(*file)); | 847 paths->push_back(path->Append(*file)); |
846 } | 848 } |
847 } | 849 } |
848 } | 850 } |
849 return success; | 851 return success; |
850 } | 852 } |
851 | 853 |
852 // static | 854 // static |
853 SelectFileDialog* SelectFileDialog::Create(Listener* listener) { | 855 SelectFileDialog* SelectFileDialog::Create(Listener* listener, |
854 return new SelectFileDialogImpl(listener); | 856 ui::SelectFilePolicy* policy) { |
| 857 return new SelectFileDialogImpl(listener, policy); |
855 } | 858 } |
OLD | NEW |