| 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 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1564 | 1564 |
| 1565 if (can_show_bubble && gtk_widget_get_visible(zoom_.get())) | 1565 if (can_show_bubble && gtk_widget_get_visible(zoom_.get())) |
| 1566 ShowZoomBubble(); | 1566 ShowZoomBubble(); |
| 1567 } | 1567 } |
| 1568 | 1568 |
| 1569 void LocationBarViewGtk::UpdateZoomIcon() { | 1569 void LocationBarViewGtk::UpdateZoomIcon() { |
| 1570 TabContents* tab_contents = GetTabContents(); | 1570 TabContents* tab_contents = GetTabContents(); |
| 1571 if (!zoom_.get() || !tab_contents) | 1571 if (!zoom_.get() || !tab_contents) |
| 1572 return; | 1572 return; |
| 1573 | 1573 |
| 1574 ZoomController* zoom_controller = tab_contents->zoom_controller(); | 1574 ZoomController* zoom_controller = |
| 1575 ZoomController::FromWebContents(tab_contents->web_contents()); |
| 1575 if (!zoom_controller || zoom_controller->IsAtDefaultZoom() || | 1576 if (!zoom_controller || zoom_controller->IsAtDefaultZoom() || |
| 1576 toolbar_model_->input_in_progress()) { | 1577 toolbar_model_->input_in_progress()) { |
| 1577 gtk_widget_hide(zoom_.get()); | 1578 gtk_widget_hide(zoom_.get()); |
| 1578 ZoomBubbleGtk::Close(); | 1579 ZoomBubbleGtk::Close(); |
| 1579 return; | 1580 return; |
| 1580 } | 1581 } |
| 1581 | 1582 |
| 1582 const int zoom_resource = zoom_controller->GetResourceForZoomLevel(); | 1583 const int zoom_resource = zoom_controller->GetResourceForZoomLevel(); |
| 1583 gtk_image_set_from_pixbuf(GTK_IMAGE(zoom_image_), | 1584 gtk_image_set_from_pixbuf(GTK_IMAGE(zoom_image_), |
| 1584 theme_service_->GetImageNamed(zoom_resource)->ToGdkPixbuf()); | 1585 theme_service_->GetImageNamed(zoom_resource)->ToGdkPixbuf()); |
| (...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2135 } | 2136 } |
| 2136 | 2137 |
| 2137 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( | 2138 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( |
| 2138 ExtensionAction* action) { | 2139 ExtensionAction* action) { |
| 2139 ExtensionPopupGtk::Show( | 2140 ExtensionPopupGtk::Show( |
| 2140 action->GetPopupUrl(current_tab_id_), | 2141 action->GetPopupUrl(current_tab_id_), |
| 2141 owner_->browser_, | 2142 owner_->browser_, |
| 2142 event_box_.get(), | 2143 event_box_.get(), |
| 2143 ExtensionPopupGtk::SHOW_AND_INSPECT); | 2144 ExtensionPopupGtk::SHOW_AND_INSPECT); |
| 2144 } | 2145 } |
| OLD | NEW |