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" |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 } | 161 } |
162 | 162 |
163 // Functor for moving BookmarkManagerPrivate page actions to the right via | 163 // Functor for moving BookmarkManagerPrivate page actions to the right via |
164 // stable_partition. | 164 // stable_partition. |
165 class IsPageActionViewRightAligned { | 165 class IsPageActionViewRightAligned { |
166 public: | 166 public: |
167 explicit IsPageActionViewRightAligned(ExtensionService* extension_service) | 167 explicit IsPageActionViewRightAligned(ExtensionService* extension_service) |
168 : extension_service_(extension_service) {} | 168 : extension_service_(extension_service) {} |
169 | 169 |
170 bool operator()(PageActionWithBadgeView* page_action_view) { | 170 bool operator()(PageActionWithBadgeView* page_action_view) { |
171 return extensions::PermissionsData::HasAPIPermission( | 171 return extensions::PermissionsData::ForExtension( |
172 extension_service_->GetExtensionById( | 172 extension_service_->GetExtensionById( |
173 page_action_view->image_view()->page_action()->extension_id(), | 173 page_action_view->image_view() |
174 false), | 174 ->page_action() |
175 extensions::APIPermission::kBookmarkManagerPrivate); | 175 ->extension_id(), |
| 176 false)) |
| 177 ->HasAPIPermission(extensions::APIPermission::kBookmarkManagerPrivate); |
176 } | 178 } |
177 | 179 |
178 private: | 180 private: |
179 ExtensionService* extension_service_; | 181 ExtensionService* extension_service_; |
180 | 182 |
181 // NOTE: Can't DISALLOW_COPY_AND_ASSIGN as we pass this object by value to | 183 // NOTE: Can't DISALLOW_COPY_AND_ASSIGN as we pass this object by value to |
182 // std::stable_partition(). | 184 // std::stable_partition(). |
183 }; | 185 }; |
184 | 186 |
185 } // namespace | 187 } // namespace |
(...skipping 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1670 void LocationBarView::ModelChanged(const SearchModel::State& old_state, | 1672 void LocationBarView::ModelChanged(const SearchModel::State& old_state, |
1671 const SearchModel::State& new_state) { | 1673 const SearchModel::State& new_state) { |
1672 const bool visible = !GetToolbarModel()->input_in_progress() && | 1674 const bool visible = !GetToolbarModel()->input_in_progress() && |
1673 new_state.voice_search_supported; | 1675 new_state.voice_search_supported; |
1674 if (mic_search_view_->visible() != visible) { | 1676 if (mic_search_view_->visible() != visible) { |
1675 mic_search_view_->SetVisible(visible); | 1677 mic_search_view_->SetVisible(visible); |
1676 Layout(); | 1678 Layout(); |
1677 } | 1679 } |
1678 } | 1680 } |
1679 | 1681 |
OLD | NEW |