OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/logging.h" | 5 #include "base/logging.h" |
6 #include "chrome/browser/views/user_data_dir_dialog.h" | 6 #include "chrome/browser/views/user_data_dir_dialog.h" |
7 #include "chrome/common/l10n_util.h" | 7 #include "chrome/common/l10n_util.h" |
8 #include "chrome/common/message_box_flags.h" | 8 #include "chrome/common/message_box_flags.h" |
9 #include "chrome/views/controls/message_box_view.h" | 9 #include "chrome/views/controls/message_box_view.h" |
10 #include "chrome/views/widget/widget.h" | 10 #include "chrome/views/widget/widget.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 delete this; | 66 delete this; |
67 } | 67 } |
68 | 68 |
69 bool UserDataDirDialog::Accept() { | 69 bool UserDataDirDialog::Accept() { |
70 // Directory picker | 70 // Directory picker |
71 std::wstring dialog_title = l10n_util::GetString( | 71 std::wstring dialog_title = l10n_util::GetString( |
72 IDS_CANT_WRITE_USER_DIRECTORY_CHOOSE_DIRECTORY_BUTTON); | 72 IDS_CANT_WRITE_USER_DIRECTORY_CHOOSE_DIRECTORY_BUTTON); |
73 HWND owning_hwnd = | 73 HWND owning_hwnd = |
74 GetAncestor(message_box_view_->GetWidget()->GetNativeView(), GA_ROOT); | 74 GetAncestor(message_box_view_->GetWidget()->GetNativeView(), GA_ROOT); |
75 select_file_dialog_->SelectFile(SelectFileDialog::SELECT_FOLDER, | 75 select_file_dialog_->SelectFile(SelectFileDialog::SELECT_FOLDER, |
76 dialog_title, FilePath(), std::wstring(), | 76 dialog_title, FilePath(), NULL, |
77 0, std::wstring(), owning_hwnd, NULL); | 77 0, std::wstring(), owning_hwnd, NULL); |
78 return false; | 78 return false; |
79 } | 79 } |
80 | 80 |
81 bool UserDataDirDialog::Cancel() { | 81 bool UserDataDirDialog::Cancel() { |
82 is_blocking_ = false; | 82 is_blocking_ = false; |
83 return true; | 83 return true; |
84 } | 84 } |
85 | 85 |
86 views::View* UserDataDirDialog::GetContentsView() { | 86 views::View* UserDataDirDialog::GetContentsView() { |
87 return message_box_view_; | 87 return message_box_view_; |
88 } | 88 } |
89 | 89 |
90 bool UserDataDirDialog::Dispatch(const MSG& msg) { | 90 bool UserDataDirDialog::Dispatch(const MSG& msg) { |
91 TranslateMessage(&msg); | 91 TranslateMessage(&msg); |
92 DispatchMessage(&msg); | 92 DispatchMessage(&msg); |
93 return is_blocking_; | 93 return is_blocking_; |
94 } | 94 } |
95 | 95 |
96 void UserDataDirDialog::FileSelected(const FilePath& path, | 96 void UserDataDirDialog::FileSelected(const FilePath& path, |
97 int index, void* params) { | 97 int index, void* params) { |
98 user_data_dir_ = path.ToWStringHack(); | 98 user_data_dir_ = path.ToWStringHack(); |
99 is_blocking_ = false; | 99 is_blocking_ = false; |
100 window()->Close(); | 100 window()->Close(); |
101 } | 101 } |
102 | 102 |
103 void UserDataDirDialog::FileSelectionCanceled(void* params) { | 103 void UserDataDirDialog::FileSelectionCanceled(void* params) { |
104 } | 104 } |
OLD | NEW |