OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" | 5 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 const static int kFirstRunBubbleYOffset = 1; | 86 const static int kFirstRunBubbleYOffset = 1; |
87 | 87 |
88 // Functor for moving BookmarkManagerPrivate page actions to the right via | 88 // Functor for moving BookmarkManagerPrivate page actions to the right via |
89 // stable_partition. | 89 // stable_partition. |
90 class IsPageActionViewRightAligned { | 90 class IsPageActionViewRightAligned { |
91 public: | 91 public: |
92 explicit IsPageActionViewRightAligned(ExtensionService* extension_service) | 92 explicit IsPageActionViewRightAligned(ExtensionService* extension_service) |
93 : extension_service_(extension_service) {} | 93 : extension_service_(extension_service) {} |
94 | 94 |
95 bool operator()(PageActionDecoration* page_action_decoration) { | 95 bool operator()(PageActionDecoration* page_action_decoration) { |
96 return extensions::PermissionsData::HasAPIPermission( | 96 return extensions::PermissionsData::ForExtension( |
97 extension_service_->GetExtensionById( | 97 extension_service_->GetExtensionById( |
98 page_action_decoration->page_action()->extension_id(), | 98 page_action_decoration->page_action()->extension_id(), |
99 false), | 99 false)) |
100 extensions::APIPermission::kBookmarkManagerPrivate); | 100 ->HasAPIPermission(extensions::APIPermission::kBookmarkManagerPrivate); |
101 } | 101 } |
102 | 102 |
103 private: | 103 private: |
104 ExtensionService* extension_service_; | 104 ExtensionService* extension_service_; |
105 | 105 |
106 // NOTE: Can't DISALLOW_COPY_AND_ASSIGN as we pass this object by value to | 106 // NOTE: Can't DISALLOW_COPY_AND_ASSIGN as we pass this object by value to |
107 // std::stable_partition(). | 107 // std::stable_partition(). |
108 }; | 108 }; |
109 | 109 |
110 } | 110 } |
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
796 } | 796 } |
797 | 797 |
798 bool LocationBarViewMac::UpdateMicSearchDecorationVisibility() { | 798 bool LocationBarViewMac::UpdateMicSearchDecorationVisibility() { |
799 bool is_visible = !GetToolbarModel()->input_in_progress() && | 799 bool is_visible = !GetToolbarModel()->input_in_progress() && |
800 browser_->search_model()->voice_search_supported(); | 800 browser_->search_model()->voice_search_supported(); |
801 if (mic_search_decoration_->IsVisible() == is_visible) | 801 if (mic_search_decoration_->IsVisible() == is_visible) |
802 return false; | 802 return false; |
803 mic_search_decoration_->SetVisible(is_visible); | 803 mic_search_decoration_->SetVisible(is_visible); |
804 return true; | 804 return true; |
805 } | 805 } |
OLD | NEW |