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 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1096 const content::NotificationDetails& details) { | 1096 const content::NotificationDetails& details) { |
1097 switch (type) { | 1097 switch (type) { |
1098 case chrome::NOTIFICATION_EXTENSION_LOCATION_BAR_UPDATED: { | 1098 case chrome::NOTIFICATION_EXTENSION_LOCATION_BAR_UPDATED: { |
1099 // Only update if the updated action box was for the active tab contents. | 1099 // Only update if the updated action box was for the active tab contents. |
1100 WebContents* target_tab = content::Details<WebContents>(details).ptr(); | 1100 WebContents* target_tab = content::Details<WebContents>(details).ptr(); |
1101 if (target_tab == GetTabContents()->web_contents()) | 1101 if (target_tab == GetTabContents()->web_contents()) |
1102 UpdatePageActions(); | 1102 UpdatePageActions(); |
1103 break; | 1103 break; |
1104 } | 1104 } |
1105 | 1105 |
1106 case chrome::NOTIFICATION_PREF_CHANGED: { | |
1107 std::string* pref_name_in = content::Details<std::string>(details).ptr(); | |
1108 DCHECK(pref_name_in); | |
1109 | |
1110 if (*pref_name_in == prefs::kEditBookmarksEnabled) | |
1111 UpdateStarIcon(); | |
1112 else | |
1113 NOTREACHED(); | |
1114 break; | |
1115 } | |
1116 | |
1117 case chrome::NOTIFICATION_BROWSER_THEME_CHANGED: { | 1106 case chrome::NOTIFICATION_BROWSER_THEME_CHANGED: { |
1118 if (theme_service_->UsingNativeTheme()) { | 1107 if (theme_service_->UsingNativeTheme()) { |
1119 gtk_widget_modify_bg(tab_to_search_box_, GTK_STATE_NORMAL, NULL); | 1108 gtk_widget_modify_bg(tab_to_search_box_, GTK_STATE_NORMAL, NULL); |
1120 | 1109 |
1121 GdkColor border_color = theme_service_->GetGdkColor( | 1110 GdkColor border_color = theme_service_->GetGdkColor( |
1122 ThemeService::COLOR_FRAME); | 1111 ThemeService::COLOR_FRAME); |
1123 gtk_util::SetRoundedWindowBorderColor(tab_to_search_box_, border_color); | 1112 gtk_util::SetRoundedWindowBorderColor(tab_to_search_box_, border_color); |
1124 | 1113 |
1125 gtk_util::UndoForceFontSize(security_info_label_); | 1114 gtk_util::UndoForceFontSize(security_info_label_); |
1126 gtk_util::UndoForceFontSize(tab_to_search_full_label_); | 1115 gtk_util::UndoForceFontSize(tab_to_search_full_label_); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1169 UpdateContentSettingsIcons(); | 1158 UpdateContentSettingsIcons(); |
1170 UpdateWebIntentsButton(); | 1159 UpdateWebIntentsButton(); |
1171 break; | 1160 break; |
1172 } | 1161 } |
1173 | 1162 |
1174 default: | 1163 default: |
1175 NOTREACHED(); | 1164 NOTREACHED(); |
1176 } | 1165 } |
1177 } | 1166 } |
1178 | 1167 |
| 1168 void LocationBarViewGtk::OnPreferenceChanged(PrefServiceBase* service, |
| 1169 const std::string& pref_name) { |
| 1170 if (pref_name == prefs::kEditBookmarksEnabled) |
| 1171 UpdateStarIcon(); |
| 1172 else |
| 1173 NOTREACHED(); |
| 1174 } |
| 1175 |
1179 gboolean LocationBarViewGtk::HandleExpose(GtkWidget* widget, | 1176 gboolean LocationBarViewGtk::HandleExpose(GtkWidget* widget, |
1180 GdkEventExpose* event) { | 1177 GdkEventExpose* event) { |
1181 // If we're not using GTK theming, draw our own border over the edge pixels | 1178 // If we're not using GTK theming, draw our own border over the edge pixels |
1182 // of the background. | 1179 // of the background. |
1183 if (!GtkThemeService::GetFrom(browser_->profile())->UsingNativeTheme()) { | 1180 if (!GtkThemeService::GetFrom(browser_->profile())->UsingNativeTheme()) { |
1184 int left, center, right; | 1181 int left, center, right; |
1185 if (popup_window_mode_) { | 1182 if (popup_window_mode_) { |
1186 left = right = IDR_LOCATIONBG_POPUPMODE_EDGE; | 1183 left = right = IDR_LOCATIONBG_POPUPMODE_EDGE; |
1187 center = IDR_LOCATIONBG_POPUPMODE_CENTER; | 1184 center = IDR_LOCATIONBG_POPUPMODE_CENTER; |
1188 } else { | 1185 } else { |
(...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2136 } | 2133 } |
2137 | 2134 |
2138 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( | 2135 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( |
2139 ExtensionAction* action) { | 2136 ExtensionAction* action) { |
2140 ExtensionPopupGtk::Show( | 2137 ExtensionPopupGtk::Show( |
2141 action->GetPopupUrl(current_tab_id_), | 2138 action->GetPopupUrl(current_tab_id_), |
2142 owner_->browser_, | 2139 owner_->browser_, |
2143 event_box_.get(), | 2140 event_box_.get(), |
2144 ExtensionPopupGtk::SHOW_AND_INSPECT); | 2141 ExtensionPopupGtk::SHOW_AND_INSPECT); |
2145 } | 2142 } |
OLD | NEW |