From 5d370d7520da006443a57490b5419f84d78e9e86 Mon Sep 17 00:00:00 2001 From: "xiyuan@chromium.org" Date: Mon, 17 May 2010 16:49:57 +0000 Subject: Close options dialog when "Get Theme" is clicked. BUG=chromium-os:3061 TEST=Verify options dialog is closed when "Get Theme" link is clicked per chromium-os:3061. Review URL: http://codereview.chromium.org/2090003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47423 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/chromeos/options/options_window_view.cc | 8 ++++++-- chrome/browser/chromeos/options/options_window_view.h | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'chrome/browser/chromeos/options') diff --git a/chrome/browser/chromeos/options/options_window_view.cc b/chrome/browser/chromeos/options/options_window_view.cc index 13c136d..c072787 100644 --- a/chrome/browser/chromeos/options/options_window_view.cc +++ b/chrome/browser/chromeos/options/options_window_view.cc @@ -301,6 +301,11 @@ OptionsPageView* OptionsWindowView::GetCurrentOptionsPageView() const { } } +void CloseOptionsWindow() { + if (OptionsWindowView::instance_) + OptionsWindowView::instance_->window()->Close(); +} + gfx::NativeWindow GetOptionsViewParent() { if (Browser* b = BrowserList::GetLastActive()) return b->window()->GetNativeHandle(); @@ -322,8 +327,7 @@ void ShowOptionsWindow(OptionsPage page, // If there's already an existing options window, close it and create // a new one for the current active browser. - if (OptionsWindowView::instance_) - OptionsWindowView::instance_->window()->Close(); + chromeos::CloseOptionsWindow(); OptionsWindowView::instance_ = new OptionsWindowView(profile); views::Window::CreateChromeWindow(chromeos::GetOptionsViewParent(), diff --git a/chrome/browser/chromeos/options/options_window_view.h b/chrome/browser/chromeos/options/options_window_view.h index abcc6ae..a6b31b6 100644 --- a/chrome/browser/chromeos/options/options_window_view.h +++ b/chrome/browser/chromeos/options/options_window_view.h @@ -7,6 +7,9 @@ namespace chromeos { +// Closes the options dialog. +void CloseOptionsWindow(); + // Get a proper parent for options dialogs. This returns the last active browser // window for now. gfx::NativeWindow GetOptionsViewParent(); -- cgit v1.1