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 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 return NULL; | 733 return NULL; |
734 } | 734 } |
735 | 735 |
736 void LocationBarViewGtk::Update(const WebContents* contents) { | 736 void LocationBarViewGtk::Update(const WebContents* contents) { |
737 UpdateZoomIcon(); | 737 UpdateZoomIcon(); |
738 UpdateScriptBubbleIcon(); | 738 UpdateScriptBubbleIcon(); |
739 UpdateStarIcon(); | 739 UpdateStarIcon(); |
740 UpdateSiteTypeArea(); | 740 UpdateSiteTypeArea(); |
741 UpdateContentSettingsIcons(); | 741 UpdateContentSettingsIcons(); |
742 UpdatePageActions(); | 742 UpdatePageActions(); |
| 743 #if defined(ENABLE_WEB_INTENTS) |
743 UpdateWebIntentsButton(); | 744 UpdateWebIntentsButton(); |
| 745 #endif |
744 location_entry_->Update(contents); | 746 location_entry_->Update(contents); |
745 // The security level (background color) could have changed, etc. | 747 // The security level (background color) could have changed, etc. |
746 if (theme_service_->UsingNativeTheme()) { | 748 if (theme_service_->UsingNativeTheme()) { |
747 // In GTK mode, we need our parent to redraw, as it draws the text entry | 749 // In GTK mode, we need our parent to redraw, as it draws the text entry |
748 // border. | 750 // border. |
749 gtk_widget_queue_draw(gtk_widget_get_parent(widget())); | 751 gtk_widget_queue_draw(gtk_widget_get_parent(widget())); |
750 } else { | 752 } else { |
751 gtk_widget_queue_draw(widget()); | 753 gtk_widget_queue_draw(widget()); |
752 } | 754 } |
753 ZoomBubbleGtk::CloseBubble(); | 755 ZoomBubbleGtk::CloseBubble(); |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1025 size_t count_before = page_action_views_.size(); | 1027 size_t count_before = page_action_views_.size(); |
1026 page_action_views_.clear(); | 1028 page_action_views_.clear(); |
1027 if (page_action_views_.size() != count_before) { | 1029 if (page_action_views_.size() != count_before) { |
1028 content::NotificationService::current()->Notify( | 1030 content::NotificationService::current()->Notify( |
1029 chrome::NOTIFICATION_EXTENSION_PAGE_ACTION_COUNT_CHANGED, | 1031 chrome::NOTIFICATION_EXTENSION_PAGE_ACTION_COUNT_CHANGED, |
1030 content::Source<LocationBar>(this), | 1032 content::Source<LocationBar>(this), |
1031 content::NotificationService::NoDetails()); | 1033 content::NotificationService::NoDetails()); |
1032 } | 1034 } |
1033 } | 1035 } |
1034 | 1036 |
| 1037 #if defined(ENABLE_WEB_INTENTS) |
1035 void LocationBarViewGtk::UpdateWebIntentsButton() { | 1038 void LocationBarViewGtk::UpdateWebIntentsButton() { |
1036 web_intents_button_view_->Update(GetWebContents()); | 1039 web_intents_button_view_->Update(GetWebContents()); |
1037 gtk_widget_set_visible(web_intents_hbox_.get(), | 1040 gtk_widget_set_visible(web_intents_hbox_.get(), |
1038 web_intents_button_view_->IsVisible()); | 1041 web_intents_button_view_->IsVisible()); |
1039 } | 1042 } |
| 1043 #endif |
1040 | 1044 |
1041 void LocationBarViewGtk::UpdateOpenPDFInReaderPrompt() { | 1045 void LocationBarViewGtk::UpdateOpenPDFInReaderPrompt() { |
1042 // Not implemented on Gtk. | 1046 // Not implemented on Gtk. |
1043 } | 1047 } |
1044 | 1048 |
1045 void LocationBarViewGtk::SaveStateToContents(WebContents* contents) { | 1049 void LocationBarViewGtk::SaveStateToContents(WebContents* contents) { |
1046 location_entry_->SaveStateToTab(contents); | 1050 location_entry_->SaveStateToTab(contents); |
1047 } | 1051 } |
1048 | 1052 |
1049 void LocationBarViewGtk::Revert() { | 1053 void LocationBarViewGtk::Revert() { |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1172 1, 1, 0, 0); | 1176 1, 1, 0, 0); |
1173 gtk_alignment_set_padding(GTK_ALIGNMENT(site_type_alignment_), | 1177 gtk_alignment_set_padding(GTK_ALIGNMENT(site_type_alignment_), |
1174 1, 1, 0, 0); | 1178 1, 1, 0, 0); |
1175 } | 1179 } |
1176 | 1180 |
1177 UpdateZoomIcon(); | 1181 UpdateZoomIcon(); |
1178 UpdateScriptBubbleIcon(); | 1182 UpdateScriptBubbleIcon(); |
1179 UpdateStarIcon(); | 1183 UpdateStarIcon(); |
1180 UpdateSiteTypeArea(); | 1184 UpdateSiteTypeArea(); |
1181 UpdateContentSettingsIcons(); | 1185 UpdateContentSettingsIcons(); |
| 1186 #if defined(ENABLE_WEB_INTENTS) |
1182 UpdateWebIntentsButton(); | 1187 UpdateWebIntentsButton(); |
| 1188 #endif |
1183 break; | 1189 break; |
1184 } | 1190 } |
1185 | 1191 |
1186 default: | 1192 default: |
1187 NOTREACHED(); | 1193 NOTREACHED(); |
1188 } | 1194 } |
1189 } | 1195 } |
1190 | 1196 |
1191 gboolean LocationBarViewGtk::HandleExpose(GtkWidget* widget, | 1197 gboolean LocationBarViewGtk::HandleExpose(GtkWidget* widget, |
1192 GdkEventExpose* event) { | 1198 GdkEventExpose* event) { |
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2182 } | 2188 } |
2183 | 2189 |
2184 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( | 2190 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( |
2185 ExtensionAction* action) { | 2191 ExtensionAction* action) { |
2186 ExtensionPopupGtk::Show( | 2192 ExtensionPopupGtk::Show( |
2187 action->GetPopupUrl(current_tab_id_), | 2193 action->GetPopupUrl(current_tab_id_), |
2188 owner_->browser_, | 2194 owner_->browser_, |
2189 event_box_.get(), | 2195 event_box_.get(), |
2190 ExtensionPopupGtk::SHOW_AND_INSPECT); | 2196 ExtensionPopupGtk::SHOW_AND_INSPECT); |
2191 } | 2197 } |
OLD | NEW |