OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/gtk/location_bar_view_gtk.h" | 5 #include "chrome/browser/gtk/location_bar_view_gtk.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "app/gfx/canvas_paint.h" | 9 #include "app/gfx/canvas_paint.h" |
10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
(...skipping 1189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1200 } | 1200 } |
1201 | 1201 |
1202 gboolean LocationBarViewGtk::PageActionViewGtk::OnButtonPressed( | 1202 gboolean LocationBarViewGtk::PageActionViewGtk::OnButtonPressed( |
1203 GtkWidget* sender, | 1203 GtkWidget* sender, |
1204 GdkEvent* event) { | 1204 GdkEvent* event) { |
1205 if (event->button.button != 3) { | 1205 if (event->button.button != 3) { |
1206 if (page_action_->HasPopup(current_tab_id_)) { | 1206 if (page_action_->HasPopup(current_tab_id_)) { |
1207 ExtensionPopupGtk::Show( | 1207 ExtensionPopupGtk::Show( |
1208 page_action_->GetPopupUrl(current_tab_id_), | 1208 page_action_->GetPopupUrl(current_tab_id_), |
1209 owner_->browser_, | 1209 owner_->browser_, |
1210 gtk_util::GetWidgetRectRelativeToToplevel(event_box_.get())); | 1210 gtk_util::GetWidgetRectRelativeToToplevel(event_box_.get()), |
| 1211 false); |
1211 } else { | 1212 } else { |
1212 ExtensionBrowserEventRouter::GetInstance()->PageActionExecuted( | 1213 ExtensionBrowserEventRouter::GetInstance()->PageActionExecuted( |
1213 profile_, | 1214 profile_, |
1214 page_action_->extension_id(), | 1215 page_action_->extension_id(), |
1215 page_action_->id(), | 1216 page_action_->id(), |
1216 current_tab_id_, | 1217 current_tab_id_, |
1217 current_url_.spec(), | 1218 current_url_.spec(), |
1218 event->button.button); | 1219 event->button.button); |
1219 } | 1220 } |
1220 } else { | 1221 } else { |
(...skipping 22 matching lines...) Expand all Loading... |
1243 | 1244 |
1244 std::string badge_text = page_action_->GetBadgeText(tab_id); | 1245 std::string badge_text = page_action_->GetBadgeText(tab_id); |
1245 if (badge_text.empty()) | 1246 if (badge_text.empty()) |
1246 return FALSE; | 1247 return FALSE; |
1247 | 1248 |
1248 gfx::CanvasPaint canvas(event, false); | 1249 gfx::CanvasPaint canvas(event, false); |
1249 gfx::Rect bounding_rect(widget->allocation); | 1250 gfx::Rect bounding_rect(widget->allocation); |
1250 page_action_->PaintBadge(&canvas, bounding_rect, tab_id); | 1251 page_action_->PaintBadge(&canvas, bounding_rect, tab_id); |
1251 return FALSE; | 1252 return FALSE; |
1252 } | 1253 } |
OLD | NEW |