| 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/ui/gtk/browser_titlebar.h" | 5 #include "chrome/browser/ui/gtk/browser_titlebar.h" |
| 6 | 6 |
| 7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 #include "chrome/browser/ui/toolbar/wrench_menu_model.h" | 40 #include "chrome/browser/ui/toolbar/wrench_menu_model.h" |
| 41 #include "chrome/common/chrome_notification_types.h" | 41 #include "chrome/common/chrome_notification_types.h" |
| 42 #include "chrome/common/chrome_switches.h" | 42 #include "chrome/common/chrome_switches.h" |
| 43 #include "chrome/common/pref_names.h" | 43 #include "chrome/common/pref_names.h" |
| 44 #include "content/public/browser/notification_service.h" | 44 #include "content/public/browser/notification_service.h" |
| 45 #include "content/public/browser/web_contents.h" | 45 #include "content/public/browser/web_contents.h" |
| 46 #include "grit/generated_resources.h" | 46 #include "grit/generated_resources.h" |
| 47 #include "grit/theme_resources.h" | 47 #include "grit/theme_resources.h" |
| 48 #include "grit/theme_resources_standard.h" | 48 #include "grit/theme_resources_standard.h" |
| 49 #include "grit/ui_resources.h" | 49 #include "grit/ui_resources.h" |
| 50 #include "ui/base/gtk/gtk_compat.h" |
| 50 #include "ui/base/gtk/gtk_hig_constants.h" | 51 #include "ui/base/gtk/gtk_hig_constants.h" |
| 51 #include "ui/base/l10n/l10n_util.h" | 52 #include "ui/base/l10n/l10n_util.h" |
| 52 #include "ui/base/resource/resource_bundle.h" | 53 #include "ui/base/resource/resource_bundle.h" |
| 53 #include "ui/base/x/active_window_watcher_x.h" | 54 #include "ui/base/x/active_window_watcher_x.h" |
| 54 #include "ui/gfx/gtk_util.h" | 55 #include "ui/gfx/gtk_util.h" |
| 55 #include "ui/gfx/image/image.h" | 56 #include "ui/gfx/image/image.h" |
| 56 #include "ui/gfx/skbitmap_operations.h" | 57 #include "ui/gfx/skbitmap_operations.h" |
| 57 | 58 |
| 58 using content::WebContents; | 59 using content::WebContents; |
| 59 | 60 |
| (...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 982 // Mouse is not over the close button. | 983 // Mouse is not over the close button. |
| 983 return; | 984 return; |
| 984 } | 985 } |
| 985 | 986 |
| 986 // Create and emit an enter-notify-event on close button. | 987 // Create and emit an enter-notify-event on close button. |
| 987 GValue return_value; | 988 GValue return_value; |
| 988 return_value.g_type = G_TYPE_BOOLEAN; | 989 return_value.g_type = G_TYPE_BOOLEAN; |
| 989 g_value_set_boolean(&return_value, false); | 990 g_value_set_boolean(&return_value, false); |
| 990 | 991 |
| 991 GdkEvent* event = gdk_event_new(GDK_ENTER_NOTIFY); | 992 GdkEvent* event = gdk_event_new(GDK_ENTER_NOTIFY); |
| 992 event->crossing.window = GTK_BUTTON(close_button_->widget())->event_window; | 993 event->crossing.window = |
| 994 gtk_button_get_event_window(GTK_BUTTON(close_button_->widget())); |
| 993 event->crossing.send_event = FALSE; | 995 event->crossing.send_event = FALSE; |
| 994 event->crossing.subwindow = close_button_->widget()->window; | 996 event->crossing.subwindow = gtk_widget_get_window(close_button_->widget()); |
| 995 event->crossing.time = gtk_util::XTimeNow(); | 997 event->crossing.time = gtk_util::XTimeNow(); |
| 996 event->crossing.x = x; | 998 event->crossing.x = x; |
| 997 event->crossing.y = y; | 999 event->crossing.y = y; |
| 998 event->crossing.x_root = widget_allocation.x; | 1000 event->crossing.x_root = widget_allocation.x; |
| 999 event->crossing.y_root = widget_allocation.y; | 1001 event->crossing.y_root = widget_allocation.y; |
| 1000 event->crossing.mode = GDK_CROSSING_NORMAL; | 1002 event->crossing.mode = GDK_CROSSING_NORMAL; |
| 1001 event->crossing.detail = GDK_NOTIFY_ANCESTOR; | 1003 event->crossing.detail = GDK_NOTIFY_ANCESTOR; |
| 1002 event->crossing.focus = true; | 1004 event->crossing.focus = true; |
| 1003 event->crossing.state = 0; | 1005 event->crossing.state = 0; |
| 1004 | 1006 |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1176 ui::SimpleMenuModel::Delegate* delegate) | 1178 ui::SimpleMenuModel::Delegate* delegate) |
| 1177 : SimpleMenuModel(delegate) { | 1179 : SimpleMenuModel(delegate) { |
| 1178 AddItemWithStringId(IDC_NEW_TAB, IDS_TAB_CXMENU_NEWTAB); | 1180 AddItemWithStringId(IDC_NEW_TAB, IDS_TAB_CXMENU_NEWTAB); |
| 1179 AddItemWithStringId(IDC_RESTORE_TAB, IDS_RESTORE_TAB); | 1181 AddItemWithStringId(IDC_RESTORE_TAB, IDS_RESTORE_TAB); |
| 1180 AddSeparator(); | 1182 AddSeparator(); |
| 1181 AddItemWithStringId(IDC_TASK_MANAGER, IDS_TASK_MANAGER); | 1183 AddItemWithStringId(IDC_TASK_MANAGER, IDS_TASK_MANAGER); |
| 1182 AddSeparator(); | 1184 AddSeparator(); |
| 1183 AddCheckItemWithStringId(kShowWindowDecorationsCommand, | 1185 AddCheckItemWithStringId(kShowWindowDecorationsCommand, |
| 1184 IDS_SHOW_WINDOW_DECORATIONS_MENU); | 1186 IDS_SHOW_WINDOW_DECORATIONS_MENU); |
| 1185 } | 1187 } |
| OLD | NEW |