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

Side by Side Diff: chrome/common/extensions/api/extension_action/action_info.cc

Issue 11644057: Move BrowserAction out of Extension (Closed) Base URL: http://git.chromium.org/chromium/src.git@dc_ungoop_extension_action
Patch Set: Combined ActionInfo wrappers Created 7 years, 12 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
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/common/extensions/api/extension_action/action_info.h" 5 #include "chrome/common/extensions/api/extension_action/action_info.h"
6 #include "chrome/common/extensions/extension_manifest_constants.h"
6 7
7 namespace extensions { 8 namespace extensions {
8 9
10 namespace {
11
12 static const ActionInfo* GetActionInfo(const Extension* extension,
13 const std::string& key) {
14 ActionInfoData* data = static_cast<ActionInfoData*>(
15 extension->GetManifestData(key));
16 return data ? data->action_info.get() : NULL;
17 }
18
19 } // namespace
20
9 ActionInfo::ActionInfo() {} 21 ActionInfo::ActionInfo() {}
10 ActionInfo::~ActionInfo() {} 22 ActionInfo::~ActionInfo() {}
11 23
24 ActionInfoData::ActionInfoData(ActionInfo* info) : action_info(info) {
25 }
26
27 ActionInfoData::~ActionInfoData() {
28 }
29
30 const ActionInfo* ActionInfoData::GetBrowserActionInfo(
31 const Extension* extension) {
32 return GetActionInfo(extension, extension_manifest_keys::kBrowserAction);
33 }
34
35 const ActionInfo* ActionInfoData::GetScriptBadgeInfo(
36 const Extension* extension) {
37 return GetActionInfo(extension, extension_manifest_keys::kScriptBadge);
38 }
39
12 } // namespace extensions 40 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698