| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 | 181 |
| 182 // | 182 // |
| 183 // ExtensionActionAPI | 183 // ExtensionActionAPI |
| 184 // | 184 // |
| 185 | 185 |
| 186 static base::LazyInstance<ProfileKeyedAPIFactory<ExtensionActionAPI> > | 186 static base::LazyInstance<ProfileKeyedAPIFactory<ExtensionActionAPI> > |
| 187 g_factory = LAZY_INSTANCE_INITIALIZER; | 187 g_factory = LAZY_INSTANCE_INITIALIZER; |
| 188 | 188 |
| 189 ExtensionActionAPI::ExtensionActionAPI(Profile* profile) { | 189 ExtensionActionAPI::ExtensionActionAPI(Profile* profile) { |
| 190 ManifestHandler::Register(extension_manifest_keys::kBrowserAction, | 190 ManifestHandler::Register(extension_manifest_keys::kBrowserAction, |
| 191 new BrowserActionHandler); | 191 make_linked_ptr(new BrowserActionHandler)); |
| 192 ManifestHandler::Register(extension_manifest_keys::kScriptBadge, | 192 ManifestHandler::Register(extension_manifest_keys::kScriptBadge, |
| 193 new ScriptBadgeHandler); | 193 make_linked_ptr(new ScriptBadgeHandler)); |
| 194 | 194 |
| 195 ExtensionFunctionRegistry* registry = | 195 ExtensionFunctionRegistry* registry = |
| 196 ExtensionFunctionRegistry::GetInstance(); | 196 ExtensionFunctionRegistry::GetInstance(); |
| 197 | 197 |
| 198 // Browser Actions | 198 // Browser Actions |
| 199 registry->RegisterFunction<BrowserActionSetIconFunction>(); | 199 registry->RegisterFunction<BrowserActionSetIconFunction>(); |
| 200 registry->RegisterFunction<BrowserActionSetTitleFunction>(); | 200 registry->RegisterFunction<BrowserActionSetTitleFunction>(); |
| 201 registry->RegisterFunction<BrowserActionSetBadgeTextFunction>(); | 201 registry->RegisterFunction<BrowserActionSetBadgeTextFunction>(); |
| 202 registry->RegisterFunction<BrowserActionSetBadgeBackgroundColorFunction>(); | 202 registry->RegisterFunction<BrowserActionSetBadgeBackgroundColorFunction>(); |
| 203 registry->RegisterFunction<BrowserActionSetPopupFunction>(); | 203 registry->RegisterFunction<BrowserActionSetPopupFunction>(); |
| (...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 return true; | 727 return true; |
| 728 } | 728 } |
| 729 | 729 |
| 730 bool EnablePageActionsFunction::RunImpl() { | 730 bool EnablePageActionsFunction::RunImpl() { |
| 731 return SetPageActionEnabled(true); | 731 return SetPageActionEnabled(true); |
| 732 } | 732 } |
| 733 | 733 |
| 734 bool DisablePageActionsFunction::RunImpl() { | 734 bool DisablePageActionsFunction::RunImpl() { |
| 735 return SetPageActionEnabled(false); | 735 return SetPageActionEnabled(false); |
| 736 } | 736 } |
| OLD | NEW |