summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/native_dialog_window.cc
diff options
context:
space:
mode:
authorxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-11 19:01:59 +0000
committerxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-11 19:01:59 +0000
commit07c71b1872598f1fcc6183d73aca1642ac2b80c9 (patch)
treed29a51b445d34c96d2b19499426b6d0865d52d1b /chrome/browser/chromeos/native_dialog_window.cc
parentcf9a7bcd8f9e552264b7d0024b4172f401804c46 (diff)
downloadchromium_src-07c71b1872598f1fcc6183d73aca1642ac2b80c9.zip
chromium_src-07c71b1872598f1fcc6183d73aca1642ac2b80c9.tar.gz
chromium_src-07c71b1872598f1fcc6183d73aca1642ac2b80c9.tar.bz2
Fix issue 3967 and a couple related issues.
- Improve gtk_util::ShowDialog to respect dialog size and resizable trait; - Make TaskManagerGtk remember correct geometry info; - Use gtk_util::PresentWindow instead of gek_window_present; BUG=chromium-os:3967 TEST=Verify fix for chromium-os:3967 Review URL: http://codereview.chromium.org/2776005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49566 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/native_dialog_window.cc')
-rw-r--r--chrome/browser/chromeos/native_dialog_window.cc17
1 files changed, 12 insertions, 5 deletions
diff --git a/chrome/browser/chromeos/native_dialog_window.cc b/chrome/browser/chromeos/native_dialog_window.cc
index 07693ec..ec9ffbf 100644
--- a/chrome/browser/chromeos/native_dialog_window.cc
+++ b/chrome/browser/chromeos/native_dialog_window.cc
@@ -16,7 +16,7 @@ namespace {
const int kDialogPadding = 3;
-const char kNativeDialogHostWindow[] = "_chromeos_native_dialog_host_window_";
+const char kNativeDialogHost[] = "_chromeos_native_dialog_host_";
} // namespace
@@ -179,8 +179,8 @@ void NativeDialogHost::Init() {
g_object_unref(dialog_contents);
gtk_widget_hide(dialog_);
- g_object_set_data(G_OBJECT(dialog_), kNativeDialogHostWindow,
- reinterpret_cast<gpointer>(window()->GetNativeWindow()));
+ g_object_set_data(G_OBJECT(dialog_), kNativeDialogHost,
+ reinterpret_cast<gpointer>(this));
gtk_widget_show_all(contents);
@@ -229,8 +229,15 @@ void ShowNativeDialog(gfx::NativeWindow parent,
}
gfx::NativeWindow GetNativeDialogWindow(gfx::NativeView native_dialog) {
- return reinterpret_cast<gfx::NativeWindow>(
- g_object_get_data(G_OBJECT(native_dialog), kNativeDialogHostWindow));
+ NativeDialogHost* host = reinterpret_cast<NativeDialogHost*>(
+ g_object_get_data(G_OBJECT(native_dialog), kNativeDialogHost));
+ return host ? host->window()->GetNativeWindow() : NULL;
+}
+
+gfx::Rect GetNativeDialogContentsBounds(gfx::NativeView native_dialog) {
+ NativeDialogHost* host = reinterpret_cast<NativeDialogHost*>(
+ g_object_get_data(G_OBJECT(native_dialog), kNativeDialogHost));
+ return host ? host->bounds() : gfx::Rect();
}
} // namespace chromeos