| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/native_dialog_window.h" | 5 #include "chrome/browser/chromeos/native_dialog_window.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 preferred_size_.set_width(requsition.width); | 146 preferred_size_.set_width(requsition.width); |
| 147 preferred_size_.set_height(requsition.height); | 147 preferred_size_.set_height(requsition.height); |
| 148 CheckSize(); | 148 CheckSize(); |
| 149 SizeToPreferredSize(); | 149 SizeToPreferredSize(); |
| 150 | 150 |
| 151 gfx::Size window_size = | 151 gfx::Size window_size = |
| 152 GetWidget()->non_client_view()->GetPreferredSize(); | 152 GetWidget()->non_client_view()->GetPreferredSize(); |
| 153 gfx::Rect window_bounds = GetWidget()->GetWindowScreenBounds(); | 153 gfx::Rect window_bounds = GetWidget()->GetWindowScreenBounds(); |
| 154 window_bounds.set_width(window_size.width()); | 154 window_bounds.set_width(window_size.width()); |
| 155 window_bounds.set_height(window_size.height()); | 155 window_bounds.set_height(window_size.height()); |
| 156 GetWidget()->SetBoundsConstrained(window_bounds, NULL); | 156 GetWidget()->SetBoundsConstrained(window_bounds); |
| 157 } | 157 } |
| 158 } | 158 } |
| 159 } | 159 } |
| 160 | 160 |
| 161 void NativeDialogHost::OnDialogDestroy(GtkWidget* widget) { | 161 void NativeDialogHost::OnDialogDestroy(GtkWidget* widget) { |
| 162 dialog_ = NULL; | 162 dialog_ = NULL; |
| 163 destroy_signal_id_ = 0; | 163 destroy_signal_id_ = 0; |
| 164 GetWidget()->Close(); | 164 GetWidget()->Close(); |
| 165 } | 165 } |
| 166 | 166 |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 return host ? host->GetWidget()->GetNativeWindow() : NULL; | 341 return host ? host->GetWidget()->GetNativeWindow() : NULL; |
| 342 } | 342 } |
| 343 | 343 |
| 344 gfx::Rect GetNativeDialogContentsBounds(gfx::NativeView native_dialog) { | 344 gfx::Rect GetNativeDialogContentsBounds(gfx::NativeView native_dialog) { |
| 345 NativeDialogHost* host = reinterpret_cast<NativeDialogHost*>( | 345 NativeDialogHost* host = reinterpret_cast<NativeDialogHost*>( |
| 346 g_object_get_data(G_OBJECT(native_dialog), kNativeDialogHost)); | 346 g_object_get_data(G_OBJECT(native_dialog), kNativeDialogHost)); |
| 347 return host ? host->bounds() : gfx::Rect(); | 347 return host ? host->bounds() : gfx::Rect(); |
| 348 } | 348 } |
| 349 | 349 |
| 350 } // namespace chromeos | 350 } // namespace chromeos |
| OLD | NEW |