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

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: Use raw pointer + IconImage signature changed 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/logging.h"
8 #include "base/utf_string_conversions.h"
9 #include "base/values.h"
10 #include "chrome/common/extensions/api/extension_action/action_info.h"
11 #include "chrome/common/extensions/extension.h"
12 #include "chrome/common/extensions/extension_manifest_constants.h"
13 #include "chrome/common/extensions/manifest.h"
14 #include "chrome/common/extensions/manifest_handler_helpers.h"
15
16 namespace keys = extension_manifest_keys;
17
18 namespace extensions {
19
20 PageLauncherHandler::PageLauncherHandler() {
21 }
22
23 PageLauncherHandler::~PageLauncherHandler() {
24 }
25
26 bool PageLauncherHandler::Parse(Extension* extension, string16* error) {
27 DCHECK(extension->manifest()->HasKey(keys::kPageLauncher));
28
29 const base::DictionaryValue* dict;
30 if (!extension->manifest()->GetDictionary(keys::kPageLauncher, &dict)) {
31 *error = ASCIIToUTF16(extension_manifest_errors::kInvalidPageLauncher);
32 return false;
33 }
34
35 scoped_ptr<ActionInfo> action_info =
36 manifest_handler_helpers::LoadActionInfo(extension, dict, error);
37 if (!action_info)
38 return false;
39
40 ActionInfo::SetPageLauncherInfo(extension, action_info.release());
41 return true;
42 }
43
44 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698