| 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 "ui/views/widget/tooltip_manager_gtk.h" | 5 #include "ui/views/widget/tooltip_manager_gtk.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "ui/gfx/font.h" | 9 #include "ui/gfx/font.h" |
| 10 #include "ui/gfx/screen.h" | 10 #include "ui/gfx/screen.h" |
| 11 #include "ui/views/focus/focus_manager.h" | 11 #include "ui/views/focus/focus_manager.h" |
| 12 #include "ui/views/view.h" |
| 12 #include "ui/views/widget/native_widget_gtk.h" | 13 #include "ui/views/widget/native_widget_gtk.h" |
| 13 #include "views/view.h" | |
| 14 | 14 |
| 15 // WARNING: this implementation is good for a start, but it doesn't give us | 15 // WARNING: this implementation is good for a start, but it doesn't give us |
| 16 // control of tooltip positioning both on mouse events and when showing from | 16 // control of tooltip positioning both on mouse events and when showing from |
| 17 // keyboard. We may need to write our own to give us the control we need. | 17 // keyboard. We may need to write our own to give us the control we need. |
| 18 | 18 |
| 19 namespace views { | 19 namespace views { |
| 20 | 20 |
| 21 static gfx::Font* LoadDefaultFont() { | 21 static gfx::Font* LoadDefaultFont() { |
| 22 // Create a tooltip widget and extract the font from it (we have to realize | 22 // Create a tooltip widget and extract the font from it (we have to realize |
| 23 // it to make sure the correct font gets set). | 23 // it to make sure the correct font gets set). |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 if (!g_signal_parse_name("show_help", itype, &signal_id, &detail, FALSE)) { | 165 if (!g_signal_parse_name("show_help", itype, &signal_id, &detail, FALSE)) { |
| 166 NOTREACHED(); | 166 NOTREACHED(); |
| 167 return false; | 167 return false; |
| 168 } | 168 } |
| 169 gboolean result; | 169 gboolean result; |
| 170 g_signal_emit(widget, signal_id, 0, GTK_WIDGET_HELP_TOOLTIP, &result); | 170 g_signal_emit(widget, signal_id, 0, GTK_WIDGET_HELP_TOOLTIP, &result); |
| 171 return true; | 171 return true; |
| 172 } | 172 } |
| 173 | 173 |
| 174 } // namespace views | 174 } // namespace views |
| OLD | NEW |