Chromium Code Reviews| OLD | NEW |
|---|---|
| (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, | |
| 27 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.
| |
| 28 DCHECK(extension->manifest()->HasKey(keys::kPageLauncher)); | |
| 29 | |
| 30 const base::DictionaryValue* dict; | |
| 31 if (!extension->manifest()->GetDictionary(keys::kPageLauncher, &dict)) { | |
| 32 *error = ASCIIToUTF16(extension_manifest_errors::kInvalidPageLauncher); | |
| 33 return false; | |
| 34 } | |
| 35 | |
| 36 scoped_ptr<ActionInfo> action_info = | |
| 37 manifest_handler_helpers::LoadActionInfo(extension, dict, error); | |
| 38 if (!action_info) | |
| 39 return false; | |
| 40 | |
| 41 ActionInfo::SetPageLauncherInfo(extension, action_info.release()); | |
| 42 return true; | |
| 43 } | |
| 44 | |
| 45 } // namespace extensions | |
| OLD | NEW |