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

Side by Side Diff: chrome/common/extensions/api/page_launcher/page_launcher_handler.cc

Issue 12095023: Allow platform apps to add themselves to the Action Box. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase 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) 2013 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/page_launcher/page_launcher_handler.h"
6
7 #include "base/utf_string_conversions.h"
8 #include "base/values.h"
9 #include "chrome/common/extensions/api/extension_action/action_info.h"
10 #include "chrome/common/extensions/extension.h"
11 #include "chrome/common/extensions/extension_manifest_constants.h"
12 #include "chrome/common/extensions/manifest_handler_helpers.h"
13
14 namespace keys = extension_manifest_keys;
15
16 namespace extensions {
17
18 PageLauncherHandler::PageLauncherHandler() {
19 }
20
21 PageLauncherHandler::~PageLauncherHandler() {
22 }
23
24 bool PageLauncherHandler::Parse(const base::Value* value,
25 Extension* extension,
26 string16* error) {
27 const base::DictionaryValue* dict;
28 if (!value->GetAsDictionary(&dict)) {
29 *error = ASCIIToUTF16(extension_manifest_errors::kInvalidPageLauncher);
30 return false;
31 }
32
33 scoped_ptr<ActionInfo> action_info =
34 manifest_handler_helpers::LoadActionInfo(extension, dict, error);
35 if (!action_info)
36 return false;
37
38 ActionInfo::SetPageLauncherInfo(extension, action_info.release());
39 return true;
40 }
41
42 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698