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/location_bar_view_gtk.h" | 5 #include "chrome/browser/ui/gtk/location_bar_view_gtk.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1039 // (0,0) event coordinates indicates that the release came at the end of | 1039 // (0,0) event coordinates indicates that the release came at the end of |
1040 // a drag. | 1040 // a drag. |
1041 if (event->x == 0 && event->y == 0) | 1041 if (event->x == 0 && event->y == 0) |
1042 return FALSE; | 1042 return FALSE; |
1043 | 1043 |
1044 NavigationEntry* nav_entry = tab->GetController().GetActiveEntry(); | 1044 NavigationEntry* nav_entry = tab->GetController().GetActiveEntry(); |
1045 if (!nav_entry) { | 1045 if (!nav_entry) { |
1046 NOTREACHED(); | 1046 NOTREACHED(); |
1047 return FALSE; | 1047 return FALSE; |
1048 } | 1048 } |
1049 browser_->ShowPageInfo(nav_entry->GetURL(), nav_entry->GetSSL(), true); | 1049 browser_->ShowPageInfo(tab, nav_entry->GetURL(), nav_entry->GetSSL(), true); |
1050 return TRUE; | 1050 return TRUE; |
1051 } else if (event->button == 2) { | 1051 } else if (event->button == 2) { |
1052 // When the user middle clicks on the location icon, try to open the | 1052 // When the user middle clicks on the location icon, try to open the |
1053 // contents of the PRIMARY selection in the current tab. | 1053 // contents of the PRIMARY selection in the current tab. |
1054 // If the click was outside our bounds, do nothing. | 1054 // If the click was outside our bounds, do nothing. |
1055 if (!gtk_util::WidgetBounds(sender).Contains( | 1055 if (!gtk_util::WidgetBounds(sender).Contains( |
1056 gfx::Point(event->x, event->y))) { | 1056 gfx::Point(event->x, event->y))) { |
1057 return FALSE; | 1057 return FALSE; |
1058 } | 1058 } |
1059 | 1059 |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1646 std::string badge_text = page_action_->GetBadgeText(tab_id); | 1646 std::string badge_text = page_action_->GetBadgeText(tab_id); |
1647 if (badge_text.empty()) | 1647 if (badge_text.empty()) |
1648 return FALSE; | 1648 return FALSE; |
1649 | 1649 |
1650 gfx::CanvasSkiaPaint canvas(event, false); | 1650 gfx::CanvasSkiaPaint canvas(event, false); |
1651 GtkAllocation allocation; | 1651 GtkAllocation allocation; |
1652 gtk_widget_get_allocation(widget, &allocation); | 1652 gtk_widget_get_allocation(widget, &allocation); |
1653 page_action_->PaintBadge(&canvas, gfx::Rect(allocation), tab_id); | 1653 page_action_->PaintBadge(&canvas, gfx::Rect(allocation), tab_id); |
1654 return FALSE; | 1654 return FALSE; |
1655 } | 1655 } |
OLD | NEW |