| 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/views/location_bar/location_bar_view.h" | 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
| 12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
| 13 #include "chrome/app/chrome_command_ids.h" | 13 #include "chrome/app/chrome_command_ids.h" |
| 14 #include "chrome/browser/alternate_nav_url_fetcher.h" | 14 #include "chrome/browser/alternate_nav_url_fetcher.h" |
| 15 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" | 15 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" |
| 16 #include "chrome/browser/chrome_to_mobile_service.h" | 16 #include "chrome/browser/chrome_to_mobile_service.h" |
| 17 #include "chrome/browser/chrome_to_mobile_service_factory.h" | 17 #include "chrome/browser/chrome_to_mobile_service_factory.h" |
| 18 #include "chrome/browser/defaults.h" | 18 #include "chrome/browser/defaults.h" |
| 19 #include "chrome/browser/extensions/action_box_controller.h" | |
| 20 #include "chrome/browser/extensions/extension_browser_event_router.h" | 19 #include "chrome/browser/extensions/extension_browser_event_router.h" |
| 21 #include "chrome/browser/extensions/extension_service.h" | 20 #include "chrome/browser/extensions/extension_service.h" |
| 22 #include "chrome/browser/extensions/extension_tab_helper.h" | 21 #include "chrome/browser/extensions/extension_tab_helper.h" |
| 22 #include "chrome/browser/extensions/location_bar_controller.h" |
| 23 #include "chrome/browser/favicon/favicon_tab_helper.h" | 23 #include "chrome/browser/favicon/favicon_tab_helper.h" |
| 24 #include "chrome/browser/instant/instant_controller.h" | 24 #include "chrome/browser/instant/instant_controller.h" |
| 25 #include "chrome/browser/profiles/profile.h" | 25 #include "chrome/browser/profiles/profile.h" |
| 26 #include "chrome/browser/search_engines/template_url.h" | 26 #include "chrome/browser/search_engines/template_url.h" |
| 27 #include "chrome/browser/search_engines/template_url_service.h" | 27 #include "chrome/browser/search_engines/template_url_service.h" |
| 28 #include "chrome/browser/search_engines/template_url_service_factory.h" | 28 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 29 #include "chrome/browser/ui/browser.h" | 29 #include "chrome/browser/ui/browser.h" |
| 30 #include "chrome/browser/ui/browser_finder.h" | 30 #include "chrome/browser/ui/browser_finder.h" |
| 31 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 31 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 32 #include "chrome/browser/ui/view_ids.h" | 32 #include "chrome/browser/ui/view_ids.h" |
| (...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1008 std::map<ExtensionAction*, bool> old_visibility; | 1008 std::map<ExtensionAction*, bool> old_visibility; |
| 1009 for (PageActionViews::const_iterator i(page_action_views_.begin()); | 1009 for (PageActionViews::const_iterator i(page_action_views_.begin()); |
| 1010 i != page_action_views_.end(); ++i) { | 1010 i != page_action_views_.end(); ++i) { |
| 1011 old_visibility[(*i)->image_view()->page_action()] = (*i)->visible(); | 1011 old_visibility[(*i)->image_view()->page_action()] = (*i)->visible(); |
| 1012 } | 1012 } |
| 1013 | 1013 |
| 1014 std::vector<ExtensionAction*> page_actions; | 1014 std::vector<ExtensionAction*> page_actions; |
| 1015 | 1015 |
| 1016 TabContentsWrapper* tab_contents = GetTabContentsWrapper(); | 1016 TabContentsWrapper* tab_contents = GetTabContentsWrapper(); |
| 1017 if (tab_contents) { | 1017 if (tab_contents) { |
| 1018 extensions::ActionBoxController* controller = | 1018 extensions::LocationBarController* controller = |
| 1019 tab_contents->extension_tab_helper()->action_box_controller(); | 1019 tab_contents->extension_tab_helper()->location_bar_controller(); |
| 1020 page_actions.swap(*controller->GetCurrentActions()); | 1020 page_actions.swap(*controller->GetCurrentActions()); |
| 1021 } | 1021 } |
| 1022 | 1022 |
| 1023 // On startup we sometimes haven't loaded any extensions. This makes sure | 1023 // On startup we sometimes haven't loaded any extensions. This makes sure |
| 1024 // we catch up when the extensions (and any page actions) load. | 1024 // we catch up when the extensions (and any page actions) load. |
| 1025 if (page_actions.size() != page_action_views_.size()) { | 1025 if (page_actions.size() != page_action_views_.size()) { |
| 1026 DeletePageActionViews(); // Delete the old views (if any). | 1026 DeletePageActionViews(); // Delete the old views (if any). |
| 1027 | 1027 |
| 1028 page_action_views_.resize(page_actions.size()); | 1028 page_action_views_.resize(page_actions.size()); |
| 1029 View* right_anchor = chrome_to_mobile_view_; | 1029 View* right_anchor = chrome_to_mobile_view_; |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1329 return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() && | 1329 return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() && |
| 1330 !suggested_text_view_->text().empty(); | 1330 !suggested_text_view_->text().empty(); |
| 1331 } | 1331 } |
| 1332 | 1332 |
| 1333 #if !defined(USE_AURA) | 1333 #if !defined(USE_AURA) |
| 1334 OmniboxViewWin* LocationBarView::GetOmniboxViewWin() { | 1334 OmniboxViewWin* LocationBarView::GetOmniboxViewWin() { |
| 1335 return static_cast<OmniboxViewWin*>(location_entry_.get()); | 1335 return static_cast<OmniboxViewWin*>(location_entry_.get()); |
| 1336 } | 1336 } |
| 1337 #endif | 1337 #endif |
| 1338 #endif | 1338 #endif |
| OLD | NEW |