From 0f2f4b60511540e292e085ba5e1985be6bf93908 Mon Sep 17 00:00:00 2001 From: "beng@google.com" Date: Wed, 30 Jul 2008 04:12:18 +0000 Subject: 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 --- chrome/browser/views/first_run_customize_view.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'chrome/browser/views/first_run_customize_view.cc') diff --git a/chrome/browser/views/first_run_customize_view.cc b/chrome/browser/views/first_run_customize_view.cc index 6b8263a..88c824c 100644 --- a/chrome/browser/views/first_run_customize_view.cc +++ b/chrome/browser/views/first_run_customize_view.cc @@ -48,7 +48,8 @@ #include "generated_resources.h" FirstRunCustomizeView::FirstRunCustomizeView(Profile* profile, - ImporterHost* importer_host) + ImporterHost* importer_host, + CustomizeViewObserver* observer) : FirstRunViewBase(profile), main_label_(NULL), import_cbox_(NULL), @@ -57,7 +58,7 @@ FirstRunCustomizeView::FirstRunCustomizeView(Profile* profile, shortcuts_label_(NULL), desktop_shortcut_cbox_(NULL), quick_shortcut_cbox_(NULL), - customize_observer_(NULL) { + customize_observer_(observer) { importer_host_ = importer_host; DCHECK(importer_host_); SetupControls(); @@ -202,6 +203,10 @@ std::wstring FirstRunCustomizeView::GetWindowTitle() const { return l10n_util::GetString(IDS_FR_CUSTOMIZE_DLG_TITLE); } +ChromeViews::View* FirstRunCustomizeView::GetContentsView() { + return this; +} + bool FirstRunCustomizeView::Accept() { if (!IsDialogButtonEnabled(DIALOGBUTTON_OK)) return false; @@ -226,7 +231,7 @@ bool FirstRunCustomizeView::Accept() { } else { int browser_selected = import_from_combo_->GetSelectedItem(); FirstRun::ImportSettings(profile_, browser_selected, - GetDefaultImportItems(), dialog_->GetHWND()); + GetDefaultImportItems(), window()->GetHWND()); } if (default_browser_cbox_->IsSelected()) { UserMetrics::RecordAction(L"FirstRunCustom_Do_DefBrowser", profile_); -- cgit v1.1