| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1364 // Do not show page info if the user has been editing the location | 1364 // Do not show page info if the user has been editing the location |
| 1365 // bar, or the location bar is at the NTP. | 1365 // bar, or the location bar is at the NTP. |
| 1366 if (GetLocationEntry()->IsEditingOrEmpty()) | 1366 if (GetLocationEntry()->IsEditingOrEmpty()) |
| 1367 return FALSE; | 1367 return FALSE; |
| 1368 | 1368 |
| 1369 // (0,0) event coordinates indicates that the release came at the end of | 1369 // (0,0) event coordinates indicates that the release came at the end of |
| 1370 // a drag. | 1370 // a drag. |
| 1371 if (event->x == 0 && event->y == 0) | 1371 if (event->x == 0 && event->y == 0) |
| 1372 return FALSE; | 1372 return FALSE; |
| 1373 | 1373 |
| 1374 NavigationEntry* nav_entry = tab->GetController().GetActiveEntry(); | 1374 // Important to use GetVisibleEntry to match what's showing in the omnibox. |
| 1375 NavigationEntry* nav_entry = tab->GetController().GetVisibleEntry(); |
| 1375 if (!nav_entry) { | 1376 if (!nav_entry) { |
| 1376 NOTREACHED(); | 1377 NOTREACHED(); |
| 1377 return FALSE; | 1378 return FALSE; |
| 1378 } | 1379 } |
| 1379 chrome::ShowWebsiteSettings(browser_, tab, nav_entry->GetURL(), | 1380 chrome::ShowWebsiteSettings(browser_, tab, nav_entry->GetURL(), |
| 1380 nav_entry->GetSSL()); | 1381 nav_entry->GetSSL()); |
| 1381 return TRUE; | 1382 return TRUE; |
| 1382 } else if (event->button == 2) { | 1383 } else if (event->button == 2) { |
| 1383 // When the user middle clicks on the location icon, try to open the | 1384 // When the user middle clicks on the location icon, try to open the |
| 1384 // contents of the PRIMARY selection in the current tab. | 1385 // contents of the PRIMARY selection in the current tab. |
| (...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2116 } | 2117 } |
| 2117 | 2118 |
| 2118 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( | 2119 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( |
| 2119 ExtensionAction* action) { | 2120 ExtensionAction* action) { |
| 2120 ExtensionPopupGtk::Show( | 2121 ExtensionPopupGtk::Show( |
| 2121 action->GetPopupUrl(current_tab_id_), | 2122 action->GetPopupUrl(current_tab_id_), |
| 2122 owner_->browser_, | 2123 owner_->browser_, |
| 2123 event_box_.get(), | 2124 event_box_.get(), |
| 2124 ExtensionPopupGtk::SHOW_AND_INSPECT); | 2125 ExtensionPopupGtk::SHOW_AND_INSPECT); |
| 2125 } | 2126 } |
| OLD | NEW |