| 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 "chrome/browser/gtk/focus_store_gtk.h" | 5 #include "chrome/browser/gtk/focus_store_gtk.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 "chrome/common/platform_util.h" | 10 #include "chrome/browser/platform_util.h" |
| 11 | 11 |
| 12 FocusStoreGtk::FocusStoreGtk() : widget_(NULL) { | 12 FocusStoreGtk::FocusStoreGtk() : widget_(NULL) { |
| 13 } | 13 } |
| 14 | 14 |
| 15 FocusStoreGtk::~FocusStoreGtk() { | 15 FocusStoreGtk::~FocusStoreGtk() { |
| 16 DisconnectDestroyHandler(); | 16 DisconnectDestroyHandler(); |
| 17 } | 17 } |
| 18 | 18 |
| 19 void FocusStoreGtk::Store(GtkWidget* widget) { | 19 void FocusStoreGtk::Store(GtkWidget* widget) { |
| 20 DisconnectDestroyHandler(); | 20 DisconnectDestroyHandler(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 35 destroy_handler_id_ = g_signal_connect(widget_, "destroy", | 35 destroy_handler_id_ = g_signal_connect(widget_, "destroy", |
| 36 G_CALLBACK(gtk_widget_destroyed), | 36 G_CALLBACK(gtk_widget_destroyed), |
| 37 &widget_); | 37 &widget_); |
| 38 } | 38 } |
| 39 } | 39 } |
| 40 | 40 |
| 41 void FocusStoreGtk::DisconnectDestroyHandler() { | 41 void FocusStoreGtk::DisconnectDestroyHandler() { |
| 42 if (widget_) | 42 if (widget_) |
| 43 g_signal_handler_disconnect(widget_, destroy_handler_id_); | 43 g_signal_handler_disconnect(widget_, destroy_handler_id_); |
| 44 } | 44 } |
| OLD | NEW |