| 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 } | 163 } |
| 164 | 164 |
| 165 // Functor for moving BookmarkManagerPrivate page actions to the right via | 165 // Functor for moving BookmarkManagerPrivate page actions to the right via |
| 166 // stable_partition. | 166 // stable_partition. |
| 167 class IsPageActionViewRightAligned { | 167 class IsPageActionViewRightAligned { |
| 168 public: | 168 public: |
| 169 explicit IsPageActionViewRightAligned(ExtensionService* extension_service) | 169 explicit IsPageActionViewRightAligned(ExtensionService* extension_service) |
| 170 : extension_service_(extension_service) {} | 170 : extension_service_(extension_service) {} |
| 171 | 171 |
| 172 bool operator()(PageActionWithBadgeView* page_action_view) { | 172 bool operator()(PageActionWithBadgeView* page_action_view) { |
| 173 return extensions::PermissionsData::ForExtension( | 173 return extension_service_ |
| 174 extension_service_->GetExtensionById( | 174 ->GetExtensionById( |
| 175 page_action_view->image_view() | 175 page_action_view->image_view()->page_action()->extension_id(), |
| 176 ->page_action() | 176 false) |
| 177 ->extension_id(), | 177 ->permissions_data() |
| 178 false)) | |
| 179 ->HasAPIPermission(extensions::APIPermission::kBookmarkManagerPrivate); | 178 ->HasAPIPermission(extensions::APIPermission::kBookmarkManagerPrivate); |
| 180 } | 179 } |
| 181 | 180 |
| 182 private: | 181 private: |
| 183 ExtensionService* extension_service_; | 182 ExtensionService* extension_service_; |
| 184 | 183 |
| 185 // NOTE: Can't DISALLOW_COPY_AND_ASSIGN as we pass this object by value to | 184 // NOTE: Can't DISALLOW_COPY_AND_ASSIGN as we pass this object by value to |
| 186 // std::stable_partition(). | 185 // std::stable_partition(). |
| 187 }; | 186 }; |
| 188 | 187 |
| (...skipping 1618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1807 void LocationBarView::ModelChanged(const SearchModel::State& old_state, | 1806 void LocationBarView::ModelChanged(const SearchModel::State& old_state, |
| 1808 const SearchModel::State& new_state) { | 1807 const SearchModel::State& new_state) { |
| 1809 const bool visible = !GetToolbarModel()->input_in_progress() && | 1808 const bool visible = !GetToolbarModel()->input_in_progress() && |
| 1810 new_state.voice_search_supported; | 1809 new_state.voice_search_supported; |
| 1811 if (mic_search_view_->visible() != visible) { | 1810 if (mic_search_view_->visible() != visible) { |
| 1812 mic_search_view_->SetVisible(visible); | 1811 mic_search_view_->SetVisible(visible); |
| 1813 Layout(); | 1812 Layout(); |
| 1814 } | 1813 } |
| 1815 } | 1814 } |
| 1816 | 1815 |
| OLD | NEW |