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/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #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" | 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/browser_tabstrip.h" |
31 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h" | 32 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h" |
32 #include "chrome/browser/ui/search/search.h" | 33 #include "chrome/browser/ui/search/search.h" |
33 #include "chrome/browser/ui/search/search_model.h" | 34 #include "chrome/browser/ui/search/search_model.h" |
34 #include "chrome/browser/ui/search/search_types.h" | 35 #include "chrome/browser/ui/search/search_types.h" |
35 #include "chrome/browser/ui/search/search_ui.h" | 36 #include "chrome/browser/ui/search/search_ui.h" |
36 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 37 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
37 #include "chrome/browser/ui/view_ids.h" | 38 #include "chrome/browser/ui/view_ids.h" |
38 #include "chrome/browser/ui/views/browser_dialogs.h" | 39 #include "chrome/browser/ui/views/browser_dialogs.h" |
39 #include "chrome/browser/ui/views/location_bar/action_box_button_view.h" | 40 #include "chrome/browser/ui/views/location_bar/action_box_button_view.h" |
40 #include "chrome/browser/ui/views/location_bar/chrome_to_mobile_view.h" | 41 #include "chrome/browser/ui/views/location_bar/chrome_to_mobile_view.h" |
(...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1104 page_action_views_[i] = new PageActionWithBadgeView( | 1105 page_action_views_[i] = new PageActionWithBadgeView( |
1105 delegate_->CreatePageActionImageView(this, page_actions_[i])); | 1106 delegate_->CreatePageActionImageView(this, page_actions_[i])); |
1106 page_action_views_[i]->SetVisible(false); | 1107 page_action_views_[i]->SetVisible(false); |
1107 AddChildViewAt(page_action_views_[i], GetIndexOf(right_anchor)); | 1108 AddChildViewAt(page_action_views_[i], GetIndexOf(right_anchor)); |
1108 } | 1109 } |
1109 } | 1110 } |
1110 | 1111 |
1111 WebContents* contents = GetWebContentsFromDelegate(delegate_); | 1112 WebContents* contents = GetWebContentsFromDelegate(delegate_); |
1112 if (!page_action_views_.empty() && contents) { | 1113 if (!page_action_views_.empty() && contents) { |
1113 Browser* browser = browser::FindBrowserWithWebContents(contents); | 1114 Browser* browser = browser::FindBrowserWithWebContents(contents); |
1114 GURL url = browser->GetActiveWebContents()->GetURL(); | 1115 GURL url = chrome::GetActiveWebContents(browser)->GetURL(); |
1115 | 1116 |
1116 for (PageActionViews::const_iterator i(page_action_views_.begin()); | 1117 for (PageActionViews::const_iterator i(page_action_views_.begin()); |
1117 i != page_action_views_.end(); ++i) { | 1118 i != page_action_views_.end(); ++i) { |
1118 (*i)->UpdateVisibility(model_->input_in_progress() ? NULL : contents, | 1119 (*i)->UpdateVisibility(model_->input_in_progress() ? NULL : contents, |
1119 url); | 1120 url); |
1120 | 1121 |
1121 // Check if the visibility of the action changed and notify if it did. | 1122 // Check if the visibility of the action changed and notify if it did. |
1122 ExtensionAction* action = (*i)->image_view()->page_action(); | 1123 ExtensionAction* action = (*i)->image_view()->page_action(); |
1123 if (old_visibility.find(action) == old_visibility.end() || | 1124 if (old_visibility.find(action) == old_visibility.end() || |
1124 old_visibility[action] != (*i)->visible()) { | 1125 old_visibility[action] != (*i)->visible()) { |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1456 } | 1457 } |
1457 | 1458 |
1458 void LocationBarView::CleanupFadeAnimation() { | 1459 void LocationBarView::CleanupFadeAnimation() { |
1459 // Since we're no longer animating we don't need our layer. | 1460 // Since we're no longer animating we don't need our layer. |
1460 SetPaintToLayer(false); | 1461 SetPaintToLayer(false); |
1461 // Bubble labels don't need a transparent background anymore. | 1462 // Bubble labels don't need a transparent background anymore. |
1462 ev_bubble_view_->SetLabelBackgroundColor(SK_ColorWHITE); | 1463 ev_bubble_view_->SetLabelBackgroundColor(SK_ColorWHITE); |
1463 selected_keyword_view_->SetLabelBackgroundColor(SK_ColorWHITE); | 1464 selected_keyword_view_->SetLabelBackgroundColor(SK_ColorWHITE); |
1464 } | 1465 } |
1465 #endif // USE_AURA | 1466 #endif // USE_AURA |
OLD | NEW |