summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-19 16:14:58 +0000
committerkuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-19 16:14:58 +0000
commitb73cfc891d2573ab913fd029f6241df4e7907d3d (patch)
tree8a339dc500fd1e71e23fa4e4f33cc261b348ccd7
parent8227045e458705c27ca116a02fd7b9b9a75237ae (diff)
downloadchromium_src-b73cfc891d2573ab913fd029f6241df4e7907d3d.zip
chromium_src-b73cfc891d2573ab913fd029f6241df4e7907d3d.tar.gz
chromium_src-b73cfc891d2573ab913fd029f6241df4e7907d3d.tar.bz2
Linux: make import warning dialog modal.
Make ImporterHost aware of the current parent window and use that as parent for the warning dialog. BUG=13481 TEST=Start Firefox, try to import profile in Chrome and make sure the warning dialog is modal. Review URL: http://codereview.chromium.org/131080 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18816 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/gtk/import_dialog_gtk.cc1
-rw-r--r--chrome/browser/gtk/import_progress_dialog_gtk.cc1
-rw-r--r--chrome/browser/importer/importer.cc8
-rw-r--r--chrome/browser/importer/importer.h7
4 files changed, 14 insertions, 3 deletions
diff --git a/chrome/browser/gtk/import_dialog_gtk.cc b/chrome/browser/gtk/import_dialog_gtk.cc
index 4ee025e..33a12cb 100644
--- a/chrome/browser/gtk/import_dialog_gtk.cc
+++ b/chrome/browser/gtk/import_dialog_gtk.cc
@@ -35,6 +35,7 @@ ImportDialogGtk::ImportDialogGtk(GtkWindow* parent, Profile* profile) :
GTK_STOCK_CANCEL,
GTK_RESPONSE_REJECT,
NULL);
+ importer_host_->set_parent_window(GTK_WINDOW(dialog_));
// Add import button separately as we might need to disable it, if
// no supported browsers found.
diff --git a/chrome/browser/gtk/import_progress_dialog_gtk.cc b/chrome/browser/gtk/import_progress_dialog_gtk.cc
index 9a57bf1..d44aac4 100644
--- a/chrome/browser/gtk/import_progress_dialog_gtk.cc
+++ b/chrome/browser/gtk/import_progress_dialog_gtk.cc
@@ -122,6 +122,7 @@ ImportProgressDialogGtk::ImportProgressDialogGtk(const string16& source_profile,
GTK_STOCK_CANCEL,
GTK_RESPONSE_REJECT,
NULL);
+ importer_host_->set_parent_window(GTK_WINDOW(dialog_));
GtkWidget* content_area = GTK_DIALOG(dialog_)->vbox;
gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing);
diff --git a/chrome/browser/importer/importer.cc b/chrome/browser/importer/importer.cc
index 7be7cd0..a4987f2 100644
--- a/chrome/browser/importer/importer.cc
+++ b/chrome/browser/importer/importer.cc
@@ -401,7 +401,8 @@ ImporterHost::ImporterHost()
file_loop_(g_browser_process->file_thread()->message_loop()),
waiting_for_bookmarkbar_model_(false),
is_source_readable_(true),
- headless_(false) {
+ headless_(false),
+ parent_window_(NULL) {
DetectSourceProfiles();
}
@@ -412,7 +413,8 @@ ImporterHost::ImporterHost(MessageLoop* file_loop)
file_loop_(file_loop),
waiting_for_bookmarkbar_model_(false),
is_source_readable_(true),
- headless_(false) {
+ headless_(false),
+ parent_window_(NULL) {
DetectSourceProfiles();
}
@@ -449,7 +451,7 @@ void ImporterHost::ShowWarningDialog() {
views::Window::CreateChromeWindow(GetActiveWindow(), gfx::Rect(),
new ImporterLockView(this))->Show();
#elif defined(OS_LINUX)
- ImportLockDialogGtk::Show(NULL, this);
+ ImportLockDialogGtk::Show(parent_window_, this);
#else
// TODO(port): Need CreateChromeWindow.
NOTIMPLEMENTED();
diff --git a/chrome/browser/importer/importer.h b/chrome/browser/importer/importer.h
index c7360fd..93ed19b 100644
--- a/chrome/browser/importer/importer.h
+++ b/chrome/browser/importer/importer.h
@@ -223,6 +223,10 @@ class ImporterHost : public base::RefCounted<ImporterHost>,
return headless_;
}
+ void set_parent_window(gfx::NativeWindow parent_window) {
+ parent_window_ = parent_window;
+ }
+
// An interface which an object can implement to be notified of events during
// the import process.
class Observer {
@@ -310,6 +314,9 @@ class ImporterHost : public base::RefCounted<ImporterHost>,
// True if UI is not to be shown.
bool headless_;
+ // Parent Window to use when showing any modal dialog boxes.
+ gfx::NativeWindow parent_window_;
+
// Firefox profile lock.
scoped_ptr<FirefoxProfileLock> firefox_lock_;