summaryrefslogtreecommitdiffstats
path: root/chrome/browser/user_data_dir_dialog.cc
diff options
context:
space:
mode:
authorbeng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-30 04:12:18 +0000
committerbeng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-30 04:12:18 +0000
commit0f2f4b60511540e292e085ba5e1985be6bf93908 (patch)
tree6d6bb042fe78bb23c4eca3cf4a4222a3dab38e74 /chrome/browser/user_data_dir_dialog.cc
parentaaeb9dc745d49afa66c1b613daa5a3123f309955 (diff)
downloadchromium_src-0f2f4b60511540e292e085ba5e1985be6bf93908.zip
chromium_src-0f2f4b60511540e292e085ba5e1985be6bf93908.tar.gz
chromium_src-0f2f4b60511540e292e085ba5e1985be6bf93908.tar.bz2
Window Delegate Improvements:
- Windows now must have a Delegate. Just construct the default WindowDelegate if you don't want to have to write one in testing. - Windows now obtain their contents view by asking the delegate via WindowDelegate::GetContentsView. - Contents views no longer need to manually store a pointer to the Window that contains them, WindowDelegate does this automatically via its window() accessor. Reviewer notes: - review window_delegate.h first, then - window.h/cc - custom frame window.h/cc - constrained_window_impl.h/cc - then everything else (just updating all call sites) B=1280060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/user_data_dir_dialog.cc')
-rw-r--r--chrome/browser/user_data_dir_dialog.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/chrome/browser/user_data_dir_dialog.cc b/chrome/browser/user_data_dir_dialog.cc
index be0b9d9..56b6ba2 100644
--- a/chrome/browser/user_data_dir_dialog.cc
+++ b/chrome/browser/user_data_dir_dialog.cc
@@ -53,10 +53,7 @@ UserDataDirDialog::UserDataDirDialog(const std::wstring& user_data_dir)
message_box_view_ = new MessageBoxView(MessageBoxView::kIsConfirmMessageBox,
message_text.c_str(), std::wstring(), kDialogWidth);
- message_box_window_ = ChromeViews::Window::CreateChromeWindow(
- NULL, gfx::Rect(), message_box_view_, this);
-
- message_box_window_->Show();
+ ChromeViews::Window::CreateChromeWindow(NULL, gfx::Rect(), this)->Show();
}
UserDataDirDialog::~UserDataDirDialog() {
@@ -109,6 +106,10 @@ bool UserDataDirDialog::Cancel() {
return true;
}
+ChromeViews::View* UserDataDirDialog::GetContentsView() {
+ return message_box_view_;
+}
+
bool UserDataDirDialog::Dispatch(const MSG& msg) {
TranslateMessage(&msg);
DispatchMessage(&msg);
@@ -118,7 +119,7 @@ bool UserDataDirDialog::Dispatch(const MSG& msg) {
void UserDataDirDialog::FileSelected(const std::wstring& path, void* params) {
user_data_dir_ = path;
is_blocking_ = false;
- message_box_window_->Close();
+ window()->Close();
}
void UserDataDirDialog::FileSelectionCanceled(void* params) {