diff options
author | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-07-30 04:12:18 +0000 |
---|---|---|
committer | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-07-30 04:12:18 +0000 |
commit | 0f2f4b60511540e292e085ba5e1985be6bf93908 (patch) | |
tree | 6d6bb042fe78bb23c4eca3cf4a4222a3dab38e74 /chrome/browser/views/first_run_view.cc | |
parent | aaeb9dc745d49afa66c1b613daa5a3123f309955 (diff) | |
download | chromium_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/views/first_run_view.cc')
-rw-r--r-- | chrome/browser/views/first_run_view.cc | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/chrome/browser/views/first_run_view.cc b/chrome/browser/views/first_run_view.cc index 1beed44..d230efa 100644 --- a/chrome/browser/views/first_run_view.cc +++ b/chrome/browser/views/first_run_view.cc @@ -180,16 +180,10 @@ std::wstring FirstRunView::GetDialogButtonLabel(DialogButton button) const { void FirstRunView::OpenCustomizeDialog() { // The customize dialog now owns the importer host object. - FirstRunCustomizeView* customize_view = - new FirstRunCustomizeView(profile_, importer_host_); - - ChromeViews::Window* customize_dialog = - ChromeViews::Window::CreateChromeWindow(dialog_->GetHWND(), - gfx::Rect(), customize_view, - customize_view); - customize_dialog->Show(); - customize_view->set_dialog(customize_dialog); - customize_view->set_observer(this); + ChromeViews::Window::CreateChromeWindow( + window()->GetHWND(), + gfx::Rect(), + new FirstRunCustomizeView(profile_, importer_host_, this))->Show(); } void FirstRunView::LinkActivated(ChromeViews::Link* source, int event_flags) { @@ -200,6 +194,10 @@ std::wstring FirstRunView::GetWindowTitle() const { return l10n_util::GetString(IDS_FIRSTRUN_DLG_TITLE); } +ChromeViews::View* FirstRunView::GetContentsView() { + return this; +} + bool FirstRunView::Accept() { if (!IsDialogButtonEnabled(DIALOGBUTTON_OK)) return false; @@ -210,7 +208,7 @@ bool FirstRunView::Accept() { CreateQuickLaunchShortcut(); // Index 0 is the default browser. FirstRun::ImportSettings(profile_, 0, GetDefaultImportItems(), - dialog_->GetHWND()); + window()->GetHWND()); UserMetrics::RecordAction(L"FirstRunDef_Accept", profile_); return true; @@ -224,7 +222,7 @@ bool FirstRunView::Cancel() { // Notification from the customize dialog that the user accepted. Since all // the work is done there we got nothing else to do. void FirstRunView::CustomizeAccepted() { - dialog_->Close(); + window()->Close(); } // Notification from the customize dialog that the user cancelled. |