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

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

Issue 56026: Move message flags into a separate header that can be used (Closed)
Patch Set: ctor Created 11 years, 9 months 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
« no previous file with comments | « chrome/browser/views/restart_message_box.cc ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/common/message_box_flags.h"
8 #include "chrome/views/controls/message_box_view.h" 9 #include "chrome/views/controls/message_box_view.h"
9 #include "chrome/views/widget/widget.h" 10 #include "chrome/views/widget/widget.h"
10 #include "chrome/views/window/window.h" 11 #include "chrome/views/window/window.h"
11 #include "grit/chromium_strings.h" 12 #include "grit/chromium_strings.h"
12 #include "grit/generated_resources.h" 13 #include "grit/generated_resources.h"
13 14
14 // static 15 // static
15 std::wstring UserDataDirDialog::RunUserDataDirDialog( 16 std::wstring UserDataDirDialog::RunUserDataDirDialog(
16 const std::wstring& user_data_dir) { 17 const std::wstring& user_data_dir) {
17 // When the window closes, it will delete itself. 18 // When the window closes, it will delete itself.
18 UserDataDirDialog* dlg = new UserDataDirDialog(user_data_dir); 19 UserDataDirDialog* dlg = new UserDataDirDialog(user_data_dir);
19 MessageLoopForUI::current()->Run(dlg); 20 MessageLoopForUI::current()->Run(dlg);
20 return dlg->user_data_dir(); 21 return dlg->user_data_dir();
21 } 22 }
22 23
23 UserDataDirDialog::UserDataDirDialog(const std::wstring& user_data_dir) 24 UserDataDirDialog::UserDataDirDialog(const std::wstring& user_data_dir)
24 : select_file_dialog_(SelectFileDialog::Create(this)), 25 : select_file_dialog_(SelectFileDialog::Create(this)),
25 is_blocking_(true) { 26 is_blocking_(true) {
26 std::wstring message_text = l10n_util::GetStringF( 27 std::wstring message_text = l10n_util::GetStringF(
27 IDS_CANT_WRITE_USER_DIRECTORY_SUMMARY, user_data_dir); 28 IDS_CANT_WRITE_USER_DIRECTORY_SUMMARY, user_data_dir);
28 const int kDialogWidth = 400; 29 const int kDialogWidth = 400;
29 message_box_view_ = new MessageBoxView(MessageBoxView::kIsConfirmMessageBox, 30 message_box_view_ = new MessageBoxView(MessageBox::kIsConfirmMessageBox,
30 message_text.c_str(), std::wstring(), kDialogWidth); 31 message_text.c_str(), std::wstring(), kDialogWidth);
31 32
32 views::Window::CreateChromeWindow(NULL, gfx::Rect(), this)->Show(); 33 views::Window::CreateChromeWindow(NULL, gfx::Rect(), this)->Show();
33 } 34 }
34 35
35 UserDataDirDialog::~UserDataDirDialog() { 36 UserDataDirDialog::~UserDataDirDialog() {
36 select_file_dialog_->ListenerDestroyed(); 37 select_file_dialog_->ListenerDestroyed();
37 } 38 }
38 39
39 int UserDataDirDialog::GetDialogButtons() const { 40 int UserDataDirDialog::GetDialogButtons() const {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 } 94 }
94 95
95 void UserDataDirDialog::FileSelected(const std::wstring& path, void* params) { 96 void UserDataDirDialog::FileSelected(const std::wstring& path, void* params) {
96 user_data_dir_ = path; 97 user_data_dir_ = path;
97 is_blocking_ = false; 98 is_blocking_ = false;
98 window()->Close(); 99 window()->Close();
99 } 100 }
100 101
101 void UserDataDirDialog::FileSelectionCanceled(void* params) { 102 void UserDataDirDialog::FileSelectionCanceled(void* params) {
102 } 103 }
OLDNEW
« no previous file with comments | « chrome/browser/views/restart_message_box.cc ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698