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

Side by Side Diff: chrome/browser/extensions/api/extension_action/extension_action_api.cc

Issue 12091115: Allow manifest handlers to declare keys they depend on that must be parsed before them. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: dcronin Created 7 years, 10 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/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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698