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

Side by Side Diff: chrome/common/extensions/manifest_handlers/copresence_manifest.cc

Issue 2130803002: Deleting the copresence API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 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 2014 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/manifest_handlers/copresence_manifest.h"
6
7 #include <memory>
8 #include <string>
9 #include <vector>
10
11 #include "base/strings/utf_string_conversions.h"
12 #include "base/values.h"
13 #include "extensions/common/manifest_constants.h"
14
15 namespace extensions {
16
17 CopresenceManifestHandler::CopresenceManifestHandler() {
18 }
19
20 CopresenceManifestHandler::~CopresenceManifestHandler() {
21 }
22
23 bool CopresenceManifestHandler::Parse(Extension* extension,
24 base::string16* error) {
25 const base::DictionaryValue* copresence_config = nullptr;
26
27 if (!extension->manifest()->GetDictionary(manifest_keys::kCopresence,
28 &copresence_config)) {
29 *error = base::ASCIIToUTF16(manifest_errors::kInvalidCopresenceConfig);
30 return false;
31 }
32
33 std::unique_ptr<CopresenceManifestData> manifest_data(
34 new CopresenceManifestData);
35 if (!copresence_config->GetString(manifest_values::kApiKey,
36 &manifest_data->api_key) ||
37 manifest_data->api_key.empty()) {
38 *error = base::ASCIIToUTF16(manifest_errors::kInvalidCopresenceApiKey);
39 return false;
40 }
41
42 extension->SetManifestData(manifest_keys::kCopresence,
43 manifest_data.release());
44 return true;
45 }
46
47 const std::vector<std::string> CopresenceManifestHandler::Keys() const {
48 return SingleKey(manifest_keys::kCopresence);
49 }
50
51 CopresenceManifestData::CopresenceManifestData() {
52 }
53
54 CopresenceManifestData::~CopresenceManifestData() {
55 }
56
57 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698