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