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

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

Issue 11644057: Move BrowserAction out of Extension (Closed) Base URL: http://git.chromium.org/chromium/src.git@dc_ungoop_extension_action
Patch Set: Latest master for CQ 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/common/extensions/api/extension_action/browser_action_handler.h "
6
7 #include "base/memory/scoped_ptr.h"
8 #include "base/utf_string_conversions.h"
9 #include "base/values.h"
10 #include "chrome/common/extensions/extension.h"
11 #include "chrome/common/extensions/extension_constants.h"
12 #include "chrome/common/extensions/extension_manifest_constants.h"
13 #include "chrome/common/extensions/feature_switch.h"
14 #include "chrome/common/extensions/manifest_handler_helpers.h"
15
16 namespace extensions {
17
18 BrowserActionHandler::BrowserActionHandler() {
19 }
20
21 BrowserActionHandler::~BrowserActionHandler() {
22 }
23
24 bool BrowserActionHandler::Parse(const base::Value* value,
25 Extension* extension,
26 string16* error) {
27 const DictionaryValue* dict = NULL;
28 if (!value->GetAsDictionary(&dict)) {
29 *error = ASCIIToUTF16(extension_manifest_errors::kInvalidBrowserAction);
30 return false;
31 }
32
33 scoped_ptr<ActionInfo> action_info =
34 manifest_handler_helpers::LoadActionInfo(extension, dict, error);
35 if (!action_info.get())
36 return false; // Failed to parse browser action definition.
37
38 ActionInfo::SetBrowserActionInfo(extension, action_info.release());
39
40 return true;
41 }
42
43 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698