| 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 20 matching lines...) Expand all Loading... |
| 31 #include "chrome/browser/extensions/extension_tab_helper.h" | 31 #include "chrome/browser/extensions/extension_tab_helper.h" |
| 32 #include "chrome/browser/extensions/extension_tab_util.h" | 32 #include "chrome/browser/extensions/extension_tab_util.h" |
| 33 #include "chrome/browser/extensions/location_bar_controller.h" | 33 #include "chrome/browser/extensions/location_bar_controller.h" |
| 34 #include "chrome/browser/favicon/favicon_tab_helper.h" | 34 #include "chrome/browser/favicon/favicon_tab_helper.h" |
| 35 #include "chrome/browser/instant/instant_controller.h" | 35 #include "chrome/browser/instant/instant_controller.h" |
| 36 #include "chrome/browser/profiles/profile.h" | 36 #include "chrome/browser/profiles/profile.h" |
| 37 #include "chrome/browser/search_engines/template_url.h" | 37 #include "chrome/browser/search_engines/template_url.h" |
| 38 #include "chrome/browser/search_engines/template_url_service.h" | 38 #include "chrome/browser/search_engines/template_url_service.h" |
| 39 #include "chrome/browser/search_engines/template_url_service_factory.h" | 39 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 40 #include "chrome/browser/ui/browser.h" | 40 #include "chrome/browser/ui/browser.h" |
| 41 #include "chrome/browser/ui/browser_command_controller.h" |
| 41 #include "chrome/browser/ui/browser_commands.h" | 42 #include "chrome/browser/ui/browser_commands.h" |
| 42 #include "chrome/browser/ui/browser_content_setting_bubble_model_delegate.h" | 43 #include "chrome/browser/ui/browser_content_setting_bubble_model_delegate.h" |
| 43 #include "chrome/browser/ui/browser_list.h" | 44 #include "chrome/browser/ui/browser_list.h" |
| 44 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" | 45 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" |
| 45 #include "chrome/browser/ui/content_settings/content_setting_image_model.h" | 46 #include "chrome/browser/ui/content_settings/content_setting_image_model.h" |
| 46 #include "chrome/browser/ui/gtk/bookmarks/bookmark_bubble_gtk.h" | 47 #include "chrome/browser/ui/gtk/bookmarks/bookmark_bubble_gtk.h" |
| 47 #include "chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.h" | 48 #include "chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.h" |
| 48 #include "chrome/browser/ui/gtk/browser_window_gtk.h" | 49 #include "chrome/browser/ui/gtk/browser_window_gtk.h" |
| 49 #include "chrome/browser/ui/gtk/chrome_to_mobile_bubble_gtk.h" | 50 #include "chrome/browser/ui/gtk/chrome_to_mobile_bubble_gtk.h" |
| 50 #include "chrome/browser/ui/gtk/content_setting_bubble_gtk.h" | 51 #include "chrome/browser/ui/gtk/content_setting_bubble_gtk.h" |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 enable_location_drag_(false), | 179 enable_location_drag_(false), |
| 179 security_info_label_(NULL), | 180 security_info_label_(NULL), |
| 180 tab_to_search_alignment_(NULL), | 181 tab_to_search_alignment_(NULL), |
| 181 tab_to_search_box_(NULL), | 182 tab_to_search_box_(NULL), |
| 182 tab_to_search_full_label_(NULL), | 183 tab_to_search_full_label_(NULL), |
| 183 tab_to_search_partial_label_(NULL), | 184 tab_to_search_partial_label_(NULL), |
| 184 tab_to_search_hint_(NULL), | 185 tab_to_search_hint_(NULL), |
| 185 tab_to_search_hint_leading_label_(NULL), | 186 tab_to_search_hint_leading_label_(NULL), |
| 186 tab_to_search_hint_icon_(NULL), | 187 tab_to_search_hint_icon_(NULL), |
| 187 tab_to_search_hint_trailing_label_(NULL), | 188 tab_to_search_hint_trailing_label_(NULL), |
| 188 command_updater_(browser->command_updater()), | 189 command_updater_(browser->command_controller()->command_updater()), |
| 189 toolbar_model_(browser->toolbar_model()), | 190 toolbar_model_(browser->toolbar_model()), |
| 190 browser_(browser), | 191 browser_(browser), |
| 191 disposition_(CURRENT_TAB), | 192 disposition_(CURRENT_TAB), |
| 192 transition_(content::PageTransitionFromInt( | 193 transition_(content::PageTransitionFromInt( |
| 193 content::PAGE_TRANSITION_TYPED | | 194 content::PAGE_TRANSITION_TYPED | |
| 194 content::PAGE_TRANSITION_FROM_ADDRESS_BAR)), | 195 content::PAGE_TRANSITION_FROM_ADDRESS_BAR)), |
| 195 weak_ptr_factory_(this), | 196 weak_ptr_factory_(this), |
| 196 popup_window_mode_(false), | 197 popup_window_mode_(false), |
| 197 theme_service_(NULL), | 198 theme_service_(NULL), |
| 198 hbox_width_(0), | 199 hbox_width_(0), |
| (...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1233 ZoomBubbleGtk::Show(zoom_.get(), browser_->profile(), | 1234 ZoomBubbleGtk::Show(zoom_.get(), browser_->profile(), |
| 1234 zc->zoom_percent(), false); | 1235 zc->zoom_percent(), false); |
| 1235 return TRUE; | 1236 return TRUE; |
| 1236 } | 1237 } |
| 1237 return FALSE; | 1238 return FALSE; |
| 1238 } | 1239 } |
| 1239 | 1240 |
| 1240 gboolean LocationBarViewGtk::OnStarButtonPress(GtkWidget* widget, | 1241 gboolean LocationBarViewGtk::OnStarButtonPress(GtkWidget* widget, |
| 1241 GdkEventButton* event) { | 1242 GdkEventButton* event) { |
| 1242 if (event->button == 1) { | 1243 if (event->button == 1) { |
| 1243 browser_->ExecuteCommand(IDC_BOOKMARK_PAGE); | 1244 chrome::ExecuteCommand(browser_, IDC_BOOKMARK_PAGE); |
| 1244 return TRUE; | 1245 return TRUE; |
| 1245 } | 1246 } |
| 1246 return FALSE; | 1247 return FALSE; |
| 1247 } | 1248 } |
| 1248 | 1249 |
| 1249 gboolean LocationBarViewGtk::OnChromeToMobileButtonPress( | 1250 gboolean LocationBarViewGtk::OnChromeToMobileButtonPress( |
| 1250 GtkWidget* widget, | 1251 GtkWidget* widget, |
| 1251 GdkEventButton* event) { | 1252 GdkEventButton* event) { |
| 1252 if (event->button == 1) { | 1253 if (event->button == 1) { |
| 1253 browser_->ExecuteCommand(IDC_CHROME_TO_MOBILE_PAGE); | 1254 chrome::ExecuteCommand(browser_, IDC_CHROME_TO_MOBILE_PAGE); |
| 1254 return TRUE; | 1255 return TRUE; |
| 1255 } | 1256 } |
| 1256 return FALSE; | 1257 return FALSE; |
| 1257 } | 1258 } |
| 1258 | 1259 |
| 1259 void LocationBarViewGtk::ShowZoomBubble(int zoom_percent) { | 1260 void LocationBarViewGtk::ShowZoomBubble(int zoom_percent) { |
| 1260 if (!zoom_.get() || toolbar_model_->input_in_progress()) | 1261 if (!zoom_.get() || toolbar_model_->input_in_progress()) |
| 1261 return; | 1262 return; |
| 1262 | 1263 |
| 1263 ZoomBubbleGtk::Show(zoom_.get(), browser_->profile(), zoom_percent, true); | 1264 ZoomBubbleGtk::Show(zoom_.get(), browser_->profile(), zoom_percent, true); |
| (...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1973 } | 1974 } |
| 1974 | 1975 |
| 1975 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( | 1976 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( |
| 1976 ExtensionAction* action) { | 1977 ExtensionAction* action) { |
| 1977 ExtensionPopupGtk::Show( | 1978 ExtensionPopupGtk::Show( |
| 1978 action->GetPopupUrl(current_tab_id_), | 1979 action->GetPopupUrl(current_tab_id_), |
| 1979 owner_->browser_, | 1980 owner_->browser_, |
| 1980 event_box_.get(), | 1981 event_box_.get(), |
| 1981 ExtensionPopupGtk::SHOW_AND_INSPECT); | 1982 ExtensionPopupGtk::SHOW_AND_INSPECT); |
| 1982 } | 1983 } |
| OLD | NEW |