| 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 "views/window/window_gtk.h" | 5 #include "views/window/window_gtk.h" |
| 6 | 6 |
| 7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "ui/gfx/gtk_util.h" | 9 #include "ui/gfx/gtk_util.h" |
| 10 #include "ui/gfx/path.h" | 10 #include "ui/gfx/path.h" |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 void WindowGtk::FrameTypeChanged() { | 401 void WindowGtk::FrameTypeChanged() { |
| 402 // This is called when the Theme has changed, so forward the event to the root | 402 // This is called when the Theme has changed, so forward the event to the root |
| 403 // widget. | 403 // widget. |
| 404 ThemeChanged(); | 404 ThemeChanged(); |
| 405 } | 405 } |
| 406 | 406 |
| 407 //////////////////////////////////////////////////////////////////////////////// | 407 //////////////////////////////////////////////////////////////////////////////// |
| 408 // WindowGtk, protected: | 408 // WindowGtk, protected: |
| 409 | 409 |
| 410 WindowGtk::WindowGtk(WindowDelegate* window_delegate) | 410 WindowGtk::WindowGtk(WindowDelegate* window_delegate) |
| 411 : WidgetGtk(TYPE_WINDOW), | 411 : Window(window_delegate), |
| 412 Window(window_delegate), | |
| 413 ALLOW_THIS_IN_INITIALIZER_LIST(delegate_(this)), | 412 ALLOW_THIS_IN_INITIALIZER_LIST(delegate_(this)), |
| 414 window_state_(GDK_WINDOW_STATE_WITHDRAWN), | 413 window_state_(GDK_WINDOW_STATE_WITHDRAWN), |
| 415 window_closed_(false) { | 414 window_closed_(false) { |
| 416 SetNativeWindow(this); | 415 SetNativeWindow(this); |
| 417 is_window_ = true; | 416 is_window_ = true; |
| 418 } | 417 } |
| 419 | 418 |
| 420 void WindowGtk::InitWindow(GtkWindow* parent, const gfx::Rect& bounds) { | 419 void WindowGtk::InitWindow(GtkWindow* parent, const gfx::Rect& bounds) { |
| 421 if (parent) | 420 if (parent) |
| 422 make_transient_to_parent(); | 421 make_transient_to_parent(); |
| 423 WidgetGtk::Init(GTK_WIDGET(parent), bounds); | 422 Widget::CreateParams params(Widget::CreateParams::TYPE_WINDOW); |
| 423 params.parent = GTK_WIDGET(parent); |
| 424 params.bounds = bounds; |
| 425 GetWidget()->Init(params); |
| 424 delegate_->OnNativeWindowCreated(bounds); | 426 delegate_->OnNativeWindowCreated(bounds); |
| 425 | 427 |
| 426 g_signal_connect(G_OBJECT(GetNativeWindow()), "configure-event", | 428 g_signal_connect(G_OBJECT(GetNativeWindow()), "configure-event", |
| 427 G_CALLBACK(CallConfigureEvent), this); | 429 G_CALLBACK(CallConfigureEvent), this); |
| 428 g_signal_connect(G_OBJECT(GetNativeWindow()), "window-state-event", | 430 g_signal_connect(G_OBJECT(GetNativeWindow()), "window-state-event", |
| 429 G_CALLBACK(CallWindowStateEvent), this); | 431 G_CALLBACK(CallWindowStateEvent), this); |
| 430 } | 432 } |
| 431 | 433 |
| 432 //////////////////////////////////////////////////////////////////////////////// | 434 //////////////////////////////////////////////////////////////////////////////// |
| 433 // WindowGtk, private: | 435 // WindowGtk, private: |
| (...skipping 21 matching lines...) Expand all Loading... |
| 455 GetWindow()->window_delegate()->SaveWindowPlacement(GetBounds(), maximized); | 457 GetWindow()->window_delegate()->SaveWindowPlacement(GetBounds(), maximized); |
| 456 } | 458 } |
| 457 | 459 |
| 458 void WindowGtk::OnDestroy(GtkWidget* widget) { | 460 void WindowGtk::OnDestroy(GtkWidget* widget) { |
| 459 delegate_->OnNativeWindowDestroying(); | 461 delegate_->OnNativeWindowDestroying(); |
| 460 WidgetGtk::OnDestroy(widget); | 462 WidgetGtk::OnDestroy(widget); |
| 461 delegate_->OnNativeWindowDestroyed(); | 463 delegate_->OnNativeWindowDestroyed(); |
| 462 } | 464 } |
| 463 | 465 |
| 464 } // namespace views | 466 } // namespace views |
| OLD | NEW |