Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 309533007: Refactor PermissionsData pt1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Latest master Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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::HasAPIPermission( 173 return extensions::PermissionsData::ForExtension(
174 extension_service_->GetExtensionById( 174 extension_service_->GetExtensionById(
175 page_action_view->image_view()->page_action()->extension_id(), 175 page_action_view->image_view()
176 false), 176 ->page_action()
177 extensions::APIPermission::kBookmarkManagerPrivate); 177 ->extension_id(),
178 false))
179 ->HasAPIPermission(extensions::APIPermission::kBookmarkManagerPrivate);
178 } 180 }
179 181
180 private: 182 private:
181 ExtensionService* extension_service_; 183 ExtensionService* extension_service_;
182 184
183 // NOTE: Can't DISALLOW_COPY_AND_ASSIGN as we pass this object by value to 185 // NOTE: Can't DISALLOW_COPY_AND_ASSIGN as we pass this object by value to
184 // std::stable_partition(). 186 // std::stable_partition().
185 }; 187 };
186 188
187 } // namespace 189 } // namespace
(...skipping 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after
1805 void LocationBarView::ModelChanged(const SearchModel::State& old_state, 1807 void LocationBarView::ModelChanged(const SearchModel::State& old_state,
1806 const SearchModel::State& new_state) { 1808 const SearchModel::State& new_state) {
1807 const bool visible = !GetToolbarModel()->input_in_progress() && 1809 const bool visible = !GetToolbarModel()->input_in_progress() &&
1808 new_state.voice_search_supported; 1810 new_state.voice_search_supported;
1809 if (mic_search_view_->visible() != visible) { 1811 if (mic_search_view_->visible() != visible) {
1810 mic_search_view_->SetVisible(visible); 1812 mic_search_view_->SetVisible(visible);
1811 Layout(); 1813 Layout();
1812 } 1814 }
1813 } 1815 }
1814 1816
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698