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

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

Issue 115309: Remove even more ATL dependencies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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 | 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 "app/l10n_util.h" 5 #include "app/l10n_util.h"
6 #include "app/message_box_flags.h" 6 #include "app/message_box_flags.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/views/user_data_dir_dialog.h" 8 #include "chrome/browser/views/user_data_dir_dialog.h"
9 #include "grit/chromium_strings.h" 9 #include "grit/chromium_strings.h"
10 #include "grit/generated_resources.h" 10 #include "grit/generated_resources.h"
11 #include "views/controls/message_box_view.h" 11 #include "views/controls/message_box_view.h"
12 #include "views/widget/widget.h" 12 #include "views/widget/widget.h"
13 #include "views/window/window.h" 13 #include "views/window/window.h"
14 14
15 // static 15 // static
16 std::wstring UserDataDirDialog::RunUserDataDirDialog( 16 std::wstring UserDataDirDialog::RunUserDataDirDialog(
17 const std::wstring& user_data_dir) { 17 const std::wstring& user_data_dir) {
18 // When the window closes, it will delete itself. 18 // When the window closes, it will delete itself.
19 UserDataDirDialog* dlg = new UserDataDirDialog(user_data_dir); 19 UserDataDirDialog* dlg = new UserDataDirDialog(user_data_dir);
20 MessageLoopForUI::current()->Run(dlg); 20 MessageLoopForUI::current()->Run(dlg);
21 return dlg->user_data_dir(); 21 return dlg->user_data_dir();
22 } 22 }
23 23
24 UserDataDirDialog::UserDataDirDialog(const std::wstring& user_data_dir) 24 UserDataDirDialog::UserDataDirDialog(const std::wstring& user_data_dir)
25 : select_file_dialog_(SelectFileDialog::Create(this)), 25 : ALLOW_THIS_IN_INITIALIZER_LIST(
26 select_file_dialog_(SelectFileDialog::Create(this))),
26 is_blocking_(true) { 27 is_blocking_(true) {
27 std::wstring message_text = l10n_util::GetStringF( 28 std::wstring message_text = l10n_util::GetStringF(
28 IDS_CANT_WRITE_USER_DIRECTORY_SUMMARY, user_data_dir); 29 IDS_CANT_WRITE_USER_DIRECTORY_SUMMARY, user_data_dir);
29 const int kDialogWidth = 400; 30 const int kDialogWidth = 400;
30 message_box_view_ = new MessageBoxView(MessageBoxFlags::kIsConfirmMessageBox, 31 message_box_view_ = new MessageBoxView(MessageBoxFlags::kIsConfirmMessageBox,
31 message_text.c_str(), std::wstring(), kDialogWidth); 32 message_text.c_str(), std::wstring(), kDialogWidth);
32 33
33 views::Window::CreateChromeWindow(NULL, gfx::Rect(), this)->Show(); 34 views::Window::CreateChromeWindow(NULL, gfx::Rect(), this)->Show();
34 } 35 }
35 36
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 } 90 }
90 91
91 void UserDataDirDialog::FileSelected(const FilePath& path, 92 void UserDataDirDialog::FileSelected(const FilePath& path,
92 int index, void* params) { 93 int index, void* params) {
93 user_data_dir_ = path.ToWStringHack(); 94 user_data_dir_ = path.ToWStringHack();
94 is_blocking_ = false; 95 is_blocking_ = false;
95 } 96 }
96 97
97 void UserDataDirDialog::FileSelectionCanceled(void* params) { 98 void UserDataDirDialog::FileSelectionCanceled(void* params) {
98 } 99 }
OLDNEW
« no previous file with comments | « chrome/browser/views/toolbar_view.cc ('k') | chrome/test/interactive_ui/view_event_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698