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

Side by Side Diff: chrome/browser/views/user_data_dir_dialog.cc

Issue 10621: Adds the ability for save dialogs to take a default extension.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month 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 | Annotate | Revision Log
OLDNEW
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/views/message_box_view.h" 8 #include "chrome/views/message_box_view.h"
9 #include "chrome/views/window.h" 9 #include "chrome/views/window.h"
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 delete this; 65 delete this;
66 } 66 }
67 67
68 bool UserDataDirDialog::Accept() { 68 bool UserDataDirDialog::Accept() {
69 // Directory picker 69 // Directory picker
70 std::wstring dialog_title = l10n_util::GetString( 70 std::wstring dialog_title = l10n_util::GetString(
71 IDS_CANT_WRITE_USER_DIRECTORY_CHOOSE_DIRECTORY_BUTTON); 71 IDS_CANT_WRITE_USER_DIRECTORY_CHOOSE_DIRECTORY_BUTTON);
72 HWND owning_hwnd = 72 HWND owning_hwnd =
73 GetAncestor(message_box_view_->GetContainer()->GetHWND(), GA_ROOT); 73 GetAncestor(message_box_view_->GetContainer()->GetHWND(), GA_ROOT);
74 select_file_dialog_->SelectFile(SelectFileDialog::SELECT_FOLDER, 74 select_file_dialog_->SelectFile(SelectFileDialog::SELECT_FOLDER,
75 dialog_title, std::wstring(), owning_hwnd, 75 dialog_title, std::wstring(), std::wstring(),
76 NULL); 76 std::wstring(), owning_hwnd, NULL);
77 return false; 77 return false;
78 } 78 }
79 79
80 bool UserDataDirDialog::Cancel() { 80 bool UserDataDirDialog::Cancel() {
81 is_blocking_ = false; 81 is_blocking_ = false;
82 return true; 82 return true;
83 } 83 }
84 84
85 views::View* UserDataDirDialog::GetContentsView() { 85 views::View* UserDataDirDialog::GetContentsView() {
86 return message_box_view_; 86 return message_box_view_;
87 } 87 }
88 88
89 bool UserDataDirDialog::Dispatch(const MSG& msg) { 89 bool UserDataDirDialog::Dispatch(const MSG& msg) {
90 TranslateMessage(&msg); 90 TranslateMessage(&msg);
91 DispatchMessage(&msg); 91 DispatchMessage(&msg);
92 return is_blocking_; 92 return is_blocking_;
93 } 93 }
94 94
95 void UserDataDirDialog::FileSelected(const std::wstring& path, void* params) { 95 void UserDataDirDialog::FileSelected(const std::wstring& path, void* params) {
96 user_data_dir_ = path; 96 user_data_dir_ = path;
97 is_blocking_ = false; 97 is_blocking_ = false;
98 window()->Close(); 98 window()->Close();
99 } 99 }
100 100
101 void UserDataDirDialog::FileSelectionCanceled(void* params) { 101 void UserDataDirDialog::FileSelectionCanceled(void* params) {
102 } 102 }
103 103
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698