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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 action->button_->SetPaintOverride(GTK_STATE_ACTIVE); | 300 action->button_->SetPaintOverride(GTK_STATE_ACTIVE); |
301 menu->PopupForWidget(widget, event->button, event->time); | 301 menu->PopupForWidget(widget, event->button, event->time); |
302 | 302 |
303 return TRUE; | 303 return TRUE; |
304 } | 304 } |
305 | 305 |
306 static void OnClicked(GtkWidget* widget, BrowserActionButton* action) { | 306 static void OnClicked(GtkWidget* widget, BrowserActionButton* action) { |
307 ExtensionToolbarModel* model = action->toolbar_->model(); | 307 ExtensionToolbarModel* model = action->toolbar_->model(); |
308 const Extension* extension = action->extension_; | 308 const Extension* extension = action->extension_; |
309 Browser* browser = action->toolbar_->browser(); | 309 Browser* browser = action->toolbar_->browser(); |
310 GtkWidget* chevron = action->toolbar_->chevron(); | |
311 GURL popup_url; | 310 GURL popup_url; |
312 | 311 |
313 switch (model->ExecuteBrowserAction(extension, browser, &popup_url)) { | 312 switch (model->ExecuteBrowserAction(extension, browser, &popup_url)) { |
314 case ExtensionToolbarModel::ACTION_NONE: | 313 case ExtensionToolbarModel::ACTION_NONE: |
315 break; | 314 break; |
316 case ExtensionToolbarModel::ACTION_SHOW_POPUP: | 315 case ExtensionToolbarModel::ACTION_SHOW_POPUP: |
317 ExtensionPopupGtk::Show(popup_url, browser, chevron); | 316 ExtensionPopupGtk::Show(popup_url, browser, widget); |
318 break; | 317 break; |
319 } | 318 } |
320 } | 319 } |
321 | 320 |
322 static gboolean OnExposeEvent(GtkWidget* widget, | 321 static gboolean OnExposeEvent(GtkWidget* widget, |
323 GdkEventExpose* event, | 322 GdkEventExpose* event, |
324 BrowserActionButton* button) { | 323 BrowserActionButton* button) { |
325 int tab_id = button->toolbar_->GetCurrentTabId(); | 324 int tab_id = button->toolbar_->GetCurrentTabId(); |
326 if (tab_id < 0) | 325 if (tab_id < 0) |
327 return FALSE; | 326 return FALSE; |
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1065 | 1064 |
1066 menu->PopupAsContext(gfx::Point(event->x_root, event->y_root), | 1065 menu->PopupAsContext(gfx::Point(event->x_root, event->y_root), |
1067 event->time); | 1066 event->time); |
1068 return TRUE; | 1067 return TRUE; |
1069 } | 1068 } |
1070 | 1069 |
1071 void BrowserActionsToolbarGtk::OnButtonShowOrHide(GtkWidget* sender) { | 1070 void BrowserActionsToolbarGtk::OnButtonShowOrHide(GtkWidget* sender) { |
1072 if (!resize_animation_.is_animating()) | 1071 if (!resize_animation_.is_animating()) |
1073 UpdateChevronVisibility(); | 1072 UpdateChevronVisibility(); |
1074 } | 1073 } |
OLD | NEW |