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/extensions/api/extension_action/extension_action_api.h" | 5 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 } | 159 } |
160 | 160 |
161 void ExtensionActionAPI::SetBrowserActionVisibility( | 161 void ExtensionActionAPI::SetBrowserActionVisibility( |
162 const std::string& extension_id, | 162 const std::string& extension_id, |
163 bool visible) { | 163 bool visible) { |
164 if (GetBrowserActionVisibility(extension_id) == visible) | 164 if (GetBrowserActionVisibility(extension_id) == visible) |
165 return; | 165 return; |
166 | 166 |
167 GetExtensionPrefs()->UpdateExtensionPref(extension_id, | 167 GetExtensionPrefs()->UpdateExtensionPref(extension_id, |
168 kBrowserActionVisible, | 168 kBrowserActionVisible, |
169 new base::FundamentalValue(visible)); | 169 new base::Value(visible)); |
170 for (auto& observer : observers_) | 170 for (auto& observer : observers_) |
171 observer.OnExtensionActionVisibilityChanged(extension_id, visible); | 171 observer.OnExtensionActionVisibilityChanged(extension_id, visible); |
172 } | 172 } |
173 | 173 |
174 bool ExtensionActionAPI::ShowExtensionActionPopup( | 174 bool ExtensionActionAPI::ShowExtensionActionPopup( |
175 const Extension* extension, | 175 const Extension* extension, |
176 Browser* browser, | 176 Browser* browser, |
177 bool grant_active_tab_permissions) { | 177 bool grant_active_tab_permissions) { |
178 ExtensionAction* extension_action = | 178 ExtensionAction* extension_action = |
179 ExtensionActionManager::Get(browser_context_)->GetExtensionAction( | 179 ExtensionActionManager::Get(browser_context_)->GetExtensionAction( |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 if (host->extension_host_type() != VIEW_TYPE_EXTENSION_POPUP || | 627 if (host->extension_host_type() != VIEW_TYPE_EXTENSION_POPUP || |
628 host->extension()->id() != extension_->id()) | 628 host->extension()->id() != extension_->id()) |
629 return; | 629 return; |
630 | 630 |
631 SendResponse(true); | 631 SendResponse(true); |
632 response_sent_ = true; | 632 response_sent_ = true; |
633 registrar_.RemoveAll(); | 633 registrar_.RemoveAll(); |
634 } | 634 } |
635 | 635 |
636 } // namespace extensions | 636 } // namespace extensions |
OLD | NEW |