summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-17 16:49:57 +0000
committerxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-17 16:49:57 +0000
commit5d370d7520da006443a57490b5419f84d78e9e86 (patch)
treedef057d065926cddb4eef0c80af49a066eba9a8f /chrome/browser
parent1a474191be022e293b6f869c398bab5b30be6540 (diff)
downloadchromium_src-5d370d7520da006443a57490b5419f84d78e9e86.zip
chromium_src-5d370d7520da006443a57490b5419f84d78e9e86.tar.gz
chromium_src-5d370d7520da006443a57490b5419f84d78e9e86.tar.bz2
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
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/chromeos/options/options_window_view.cc8
-rw-r--r--chrome/browser/chromeos/options/options_window_view.h3
-rw-r--r--chrome/browser/gtk/options/content_page_gtk.cc10
3 files changed, 19 insertions, 2 deletions
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();
diff --git a/chrome/browser/gtk/options/content_page_gtk.cc b/chrome/browser/gtk/options/content_page_gtk.cc
index 8de04fb..dcdf53b 100644
--- a/chrome/browser/gtk/options/content_page_gtk.cc
+++ b/chrome/browser/gtk/options/content_page_gtk.cc
@@ -34,6 +34,10 @@
#include "grit/generated_resources.h"
#include "grit/locale_settings.h"
+#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/options/options_window_view.h"
+#endif // defined(OS_CHROMEOS)
+
namespace {
// Background color for the status label when it's showing an error.
@@ -474,6 +478,12 @@ void ContentPageGtk::OnResetDefaultThemeButtonClicked(GtkWidget* widget) {
void ContentPageGtk::OnGetThemesButtonClicked(GtkWidget* widget) {
UserMetricsRecordAction(UserMetricsAction("Options_ThemesGallery"),
profile()->GetPrefs());
+#if defined(OS_CHROMEOS)
+ // Close options dialog for ChromeOS becuase it is always stacked on top
+ // of browser window and blocks user's view.
+ chromeos::CloseOptionsWindow();
+#endif // defined(OS_CHROMEOS)
+
BrowserList::GetLastActive()->OpenThemeGalleryTabAndActivate();
}