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

Unified 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: Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/api/page_launcher/page_launcher_handler.cc
diff --git a/chrome/common/extensions/api/page_launcher/page_launcher_handler.cc b/chrome/common/extensions/api/page_launcher/page_launcher_handler.cc
new file mode 100644
index 0000000000000000000000000000000000000000..1e0e3c2e8e9cc4760aed2f2aaa6824eb93be836f
--- /dev/null
+++ b/chrome/common/extensions/api/page_launcher/page_launcher_handler.cc
@@ -0,0 +1,45 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/common/extensions/api/page_launcher/page_launcher_handler.h"
+
+#include "base/logging.h"
+#include "base/utf_string_conversions.h"
+#include "base/values.h"
+#include "chrome/common/extensions/api/extension_action/action_info.h"
+#include "chrome/common/extensions/extension.h"
+#include "chrome/common/extensions/extension_manifest_constants.h"
+#include "chrome/common/extensions/manifest.h"
+#include "chrome/common/extensions/manifest_handler_helpers.h"
+
+namespace keys = extension_manifest_keys;
+
+namespace extensions {
+
+PageLauncherHandler::PageLauncherHandler() {
+}
+
+PageLauncherHandler::~PageLauncherHandler() {
+}
+
+bool PageLauncherHandler::Parse(Extension* extension,
+ string16* error) {
not at google - send to devlin 2013/02/01 16:39:47 1 line
Rune Fevang 2013/02/01 22:12:54 Done.
+ DCHECK(extension->manifest()->HasKey(keys::kPageLauncher));
+
+ const base::DictionaryValue* dict;
+ if (!extension->manifest()->GetDictionary(keys::kPageLauncher, &dict)) {
+ *error = ASCIIToUTF16(extension_manifest_errors::kInvalidPageLauncher);
+ return false;
+ }
+
+ scoped_ptr<ActionInfo> action_info =
+ manifest_handler_helpers::LoadActionInfo(extension, dict, error);
+ if (!action_info)
+ return false;
+
+ ActionInfo::SetPageLauncherInfo(extension, action_info.release());
+ return true;
+}
+
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698