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_actions_toolbar_gtk.h" | 5 #include "chrome/browser/ui/gtk/browser_actions_toolbar_gtk.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <vector> | 10 #include <vector> |
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 } | 939 } |
940 | 940 |
941 void BrowserActionsToolbarGtk::OnSetFocus(GtkWidget* widget, | 941 void BrowserActionsToolbarGtk::OnSetFocus(GtkWidget* widget, |
942 GtkWidget* focus_widget) { | 942 GtkWidget* focus_widget) { |
943 ExtensionPopupGtk* popup = ExtensionPopupGtk::get_current_extension_popup(); | 943 ExtensionPopupGtk* popup = ExtensionPopupGtk::get_current_extension_popup(); |
944 // The focus of the parent window has changed. Close the popup. Delay the hide | 944 // The focus of the parent window has changed. Close the popup. Delay the hide |
945 // because it will destroy the RenderViewHost, which may still be on the | 945 // because it will destroy the RenderViewHost, which may still be on the |
946 // call stack. | 946 // call stack. |
947 if (!popup || popup->being_inspected()) | 947 if (!popup || popup->being_inspected()) |
948 return; | 948 return; |
949 MessageLoop::current()->PostTask( | 949 base::MessageLoop::current()->PostTask( |
950 FROM_HERE, | 950 FROM_HERE, |
951 base::Bind(&BrowserActionsToolbarGtk::HidePopup, | 951 base::Bind(&BrowserActionsToolbarGtk::HidePopup, |
952 weak_factory_.GetWeakPtr())); | 952 weak_factory_.GetWeakPtr())); |
953 } | 953 } |
954 | 954 |
955 gboolean BrowserActionsToolbarGtk::OnGripperMotionNotify( | 955 gboolean BrowserActionsToolbarGtk::OnGripperMotionNotify( |
956 GtkWidget* widget, GdkEventMotion* event) { | 956 GtkWidget* widget, GdkEventMotion* event) { |
957 if (!(event->state & GDK_BUTTON1_MASK)) | 957 if (!(event->state & GDK_BUTTON1_MASK)) |
958 return FALSE; | 958 return FALSE; |
959 | 959 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1094 | 1094 |
1095 menu->PopupAsContext(gfx::Point(event->x_root, event->y_root), | 1095 menu->PopupAsContext(gfx::Point(event->x_root, event->y_root), |
1096 event->time); | 1096 event->time); |
1097 return TRUE; | 1097 return TRUE; |
1098 } | 1098 } |
1099 | 1099 |
1100 void BrowserActionsToolbarGtk::OnButtonShowOrHide(GtkWidget* sender) { | 1100 void BrowserActionsToolbarGtk::OnButtonShowOrHide(GtkWidget* sender) { |
1101 if (!resize_animation_.is_animating()) | 1101 if (!resize_animation_.is_animating()) |
1102 UpdateChevronVisibility(); | 1102 UpdateChevronVisibility(); |
1103 } | 1103 } |
OLD | NEW |