OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/input_method/ibus_controller_impl.h" | 5 #include "chrome/browser/chromeos/input_method/ibus_controller_impl.h" |
6 | 6 |
7 #include <algorithm> // for std::reverse. | 7 #include <algorithm> // for std::reverse. |
8 #include <cstdio> | 8 #include <cstdio> |
9 #include <cstring> // for std::strcmp. | 9 #include <cstring> // for std::strcmp. |
10 #include <set> | 10 #include <set> |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 g_signal_handlers_disconnect_by_func( | 478 g_signal_handlers_disconnect_by_func( |
479 ibus_, | 479 ibus_, |
480 reinterpret_cast<gpointer>(G_CALLBACK(BusDisconnectedThunk)), | 480 reinterpret_cast<gpointer>(G_CALLBACK(BusDisconnectedThunk)), |
481 this); | 481 this); |
482 g_signal_handlers_disconnect_by_func( | 482 g_signal_handlers_disconnect_by_func( |
483 ibus_, | 483 ibus_, |
484 reinterpret_cast<gpointer>(G_CALLBACK(BusNameOwnerChangedThunk)), | 484 reinterpret_cast<gpointer>(G_CALLBACK(BusNameOwnerChangedThunk)), |
485 this); | 485 this); |
486 | 486 |
487 // Disconnect signals for the panel service as well. | 487 // Disconnect signals for the panel service as well. |
488 IBusPanelService* ibus_panel_service = IBUS_PANEL_SERVICE( | 488 // When Chrome is shutting down, g_object_get_data fails and returns NULL. |
489 g_object_get_data(G_OBJECT(ibus_), kPanelObjectKey)); | 489 // TODO(nona): Investigate the reason of failure(crosbug.com/129142). |
| 490 void* attached_data = g_object_get_data(G_OBJECT(ibus_), kPanelObjectKey); |
| 491 if (!attached_data) |
| 492 return; |
| 493 if (!G_TYPE_CHECK_INSTANCE_TYPE(attached_data, IBUS_TYPE_PANEL_SERVICE)) |
| 494 return; |
| 495 IBusPanelService* ibus_panel_service = IBUS_PANEL_SERVICE(attached_data); |
490 if (ibus_panel_service) { | 496 if (ibus_panel_service) { |
491 g_signal_handlers_disconnect_by_func( | 497 g_signal_handlers_disconnect_by_func( |
492 ibus_panel_service, | 498 ibus_panel_service, |
493 reinterpret_cast<gpointer>(G_CALLBACK(FocusInThunk)), | 499 reinterpret_cast<gpointer>(G_CALLBACK(FocusInThunk)), |
494 this); | 500 this); |
495 g_signal_handlers_disconnect_by_func( | 501 g_signal_handlers_disconnect_by_func( |
496 ibus_panel_service, | 502 ibus_panel_service, |
497 reinterpret_cast<gpointer>(G_CALLBACK(RegisterPropertiesThunk)), | 503 reinterpret_cast<gpointer>(G_CALLBACK(RegisterPropertiesThunk)), |
498 this); | 504 this); |
499 g_signal_handlers_disconnect_by_func( | 505 g_signal_handlers_disconnect_by_func( |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1108 | 1114 |
1109 // static | 1115 // static |
1110 bool IBusControllerImpl::FindAndUpdatePropertyForTesting( | 1116 bool IBusControllerImpl::FindAndUpdatePropertyForTesting( |
1111 const chromeos::input_method::InputMethodProperty& new_prop, | 1117 const chromeos::input_method::InputMethodProperty& new_prop, |
1112 chromeos::input_method::InputMethodPropertyList* prop_list) { | 1118 chromeos::input_method::InputMethodPropertyList* prop_list) { |
1113 return FindAndUpdateProperty(new_prop, prop_list); | 1119 return FindAndUpdateProperty(new_prop, prop_list); |
1114 } | 1120 } |
1115 | 1121 |
1116 } // namespace input_method | 1122 } // namespace input_method |
1117 } // namespace chromeos | 1123 } // namespace chromeos |
OLD | NEW |