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::ForExtension( | 96 return extension_service_ |
97 extension_service_->GetExtensionById( | 97 ->GetExtensionById( |
98 page_action_decoration->page_action()->extension_id(), | 98 page_action_decoration->page_action()->extension_id(), false) |
99 false)) | 99 ->permissions_data() |
100 ->HasAPIPermission(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 |
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 } | 786 } |
787 | 787 |
788 bool LocationBarViewMac::UpdateMicSearchDecorationVisibility() { | 788 bool LocationBarViewMac::UpdateMicSearchDecorationVisibility() { |
789 bool is_visible = !GetToolbarModel()->input_in_progress() && | 789 bool is_visible = !GetToolbarModel()->input_in_progress() && |
790 browser_->search_model()->voice_search_supported(); | 790 browser_->search_model()->voice_search_supported(); |
791 if (mic_search_decoration_->IsVisible() == is_visible) | 791 if (mic_search_decoration_->IsVisible() == is_visible) |
792 return false; | 792 return false; |
793 mic_search_decoration_->SetVisible(is_visible); | 793 mic_search_decoration_->SetVisible(is_visible); |
794 return true; | 794 return true; |
795 } | 795 } |
OLD | NEW |