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 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1137 for (int i = page_actions_.size() - 1; i >= 0; --i) { | 1137 for (int i = page_actions_.size() - 1; i >= 0; --i) { |
1138 page_action_views_[i] = new PageActionWithBadgeView( | 1138 page_action_views_[i] = new PageActionWithBadgeView( |
1139 delegate_->CreatePageActionImageView(this, page_actions_[i])); | 1139 delegate_->CreatePageActionImageView(this, page_actions_[i])); |
1140 page_action_views_[i]->SetVisible(false); | 1140 page_action_views_[i]->SetVisible(false); |
1141 AddChildViewAt(page_action_views_[i], GetIndexOf(right_anchor)); | 1141 AddChildViewAt(page_action_views_[i], GetIndexOf(right_anchor)); |
1142 } | 1142 } |
1143 } | 1143 } |
1144 | 1144 |
1145 WebContents* contents = GetWebContentsFromDelegate(delegate_); | 1145 WebContents* contents = GetWebContentsFromDelegate(delegate_); |
1146 if (!page_action_views_.empty() && contents) { | 1146 if (!page_action_views_.empty() && contents) { |
1147 Browser* browser = browser::FindBrowserWithWebContents(contents); | 1147 Browser* browser = |
| 1148 browser::FindBrowserForController(&contents->GetController(), NULL); |
1148 GURL url = chrome::GetActiveWebContents(browser)->GetURL(); | 1149 GURL url = chrome::GetActiveWebContents(browser)->GetURL(); |
1149 | 1150 |
1150 for (PageActionViews::const_iterator i(page_action_views_.begin()); | 1151 for (PageActionViews::const_iterator i(page_action_views_.begin()); |
1151 i != page_action_views_.end(); ++i) { | 1152 i != page_action_views_.end(); ++i) { |
1152 (*i)->UpdateVisibility(model_->input_in_progress() ? NULL : contents, | 1153 (*i)->UpdateVisibility(model_->input_in_progress() ? NULL : contents, |
1153 url); | 1154 url); |
1154 | 1155 |
1155 // Check if the visibility of the action changed and notify if it did. | 1156 // Check if the visibility of the action changed and notify if it did. |
1156 ExtensionAction* action = (*i)->image_view()->page_action(); | 1157 ExtensionAction* action = (*i)->image_view()->page_action(); |
1157 if (old_visibility.find(action) == old_visibility.end() || | 1158 if (old_visibility.find(action) == old_visibility.end() || |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1496 } | 1497 } |
1497 | 1498 |
1498 void LocationBarView::CleanupFadeAnimation() { | 1499 void LocationBarView::CleanupFadeAnimation() { |
1499 // Since we're no longer animating we don't need our layer. | 1500 // Since we're no longer animating we don't need our layer. |
1500 SetPaintToLayer(false); | 1501 SetPaintToLayer(false); |
1501 // Bubble labels don't need a transparent background anymore. | 1502 // Bubble labels don't need a transparent background anymore. |
1502 ev_bubble_view_->SetLabelBackgroundColor(SK_ColorWHITE); | 1503 ev_bubble_view_->SetLabelBackgroundColor(SK_ColorWHITE); |
1503 selected_keyword_view_->SetLabelBackgroundColor(SK_ColorWHITE); | 1504 selected_keyword_view_->SetLabelBackgroundColor(SK_ColorWHITE); |
1504 } | 1505 } |
1505 #endif // USE_AURA | 1506 #endif // USE_AURA |
OLD | NEW |