OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "views/window/window_gtk.h" | 5 #include "views/window/window_gtk.h" |
6 | 6 |
7 #include "app/gfx/path.h" | 7 #include "app/gfx/path.h" |
8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
9 #include "base/gfx/rect.h" | 9 #include "base/gfx/rect.h" |
10 #include "views/widget/root_view.h" | 10 #include "views/widget/root_view.h" |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 | 341 |
342 void WindowGtk::Init(const gfx::Rect& bounds) { | 342 void WindowGtk::Init(const gfx::Rect& bounds) { |
343 // We call this after initializing our members since our implementations of | 343 // We call this after initializing our members since our implementations of |
344 // assorted WidgetWin functions may be called during initialization. | 344 // assorted WidgetWin functions may be called during initialization. |
345 is_modal_ = window_delegate_->IsModal(); | 345 is_modal_ = window_delegate_->IsModal(); |
346 if (is_modal_) { | 346 if (is_modal_) { |
347 // TODO(erg): Fix once modality works. | 347 // TODO(erg): Fix once modality works. |
348 // BecomeModal(); | 348 // BecomeModal(); |
349 } | 349 } |
350 | 350 |
351 WidgetGtk::Init(NULL, bounds, true); | 351 WidgetGtk::Init(NULL, bounds); |
352 | 352 |
353 g_signal_connect(G_OBJECT(GetNativeWindow()), "configure-event", | 353 g_signal_connect(G_OBJECT(GetNativeWindow()), "configure-event", |
354 G_CALLBACK(CallConfigureEvent), this); | 354 G_CALLBACK(CallConfigureEvent), this); |
355 g_signal_connect(G_OBJECT(GetNativeWindow()), "window-state-event", | 355 g_signal_connect(G_OBJECT(GetNativeWindow()), "window-state-event", |
356 G_CALLBACK(CallWindowStateEvent), this); | 356 G_CALLBACK(CallWindowStateEvent), this); |
357 | 357 |
358 // Create the ClientView, add it to the NonClientView and add the | 358 // Create the ClientView, add it to the NonClientView and add the |
359 // NonClientView to the RootView. This will cause everything to be parented. | 359 // NonClientView to the RootView. This will cause everything to be parented. |
360 non_client_view_->set_client_view(window_delegate_->CreateClientView(this)); | 360 non_client_view_->set_client_view(window_delegate_->CreateClientView(this)); |
361 WidgetGtk::SetContentsView(non_client_view_); | 361 WidgetGtk::SetContentsView(non_client_view_); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 } | 414 } |
415 } | 415 } |
416 | 416 |
417 void WindowGtk::SizeWindowToDefault() { | 417 void WindowGtk::SizeWindowToDefault() { |
418 gfx::Size size = non_client_view_->GetPreferredSize(); | 418 gfx::Size size = non_client_view_->GetPreferredSize(); |
419 gfx::Rect bounds(size.width(), size.height()); | 419 gfx::Rect bounds(size.width(), size.height()); |
420 SetBounds(bounds, NULL); | 420 SetBounds(bounds, NULL); |
421 } | 421 } |
422 | 422 |
423 } // namespace views | 423 } // namespace views |
OLD | NEW |