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

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

Issue 23744004: Move the rest of extension_manifest_constants to top-level extensions/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master Created 7 years, 3 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
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/common/extensions/manifest_handlers/kiosk_enabled_info.h" 5 #include "chrome/common/extensions/manifest_handlers/kiosk_enabled_info.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/strings/string16.h" 8 #include "base/strings/string16.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #include "base/values.h" 11 #include "base/values.h"
12 #include "chrome/common/extensions/extension_manifest_constants.h" 12 #include "extensions/common/manifest_constants.h"
13 13
14 namespace extensions { 14 namespace extensions {
15 15
16 namespace keys = manifest_keys; 16 namespace keys = manifest_keys;
17 17
18 KioskEnabledInfo::KioskEnabledInfo(bool is_kiosk_enabled) 18 KioskEnabledInfo::KioskEnabledInfo(bool is_kiosk_enabled)
19 : kiosk_enabled(is_kiosk_enabled) { 19 : kiosk_enabled(is_kiosk_enabled) {
20 } 20 }
21 21
22 KioskEnabledInfo::~KioskEnabledInfo() { 22 KioskEnabledInfo::~KioskEnabledInfo() {
(...skipping 10 matching lines...) Expand all
33 } 33 }
34 34
35 KioskEnabledHandler::~KioskEnabledHandler() { 35 KioskEnabledHandler::~KioskEnabledHandler() {
36 } 36 }
37 37
38 bool KioskEnabledHandler::Parse(Extension* extension, string16* error) { 38 bool KioskEnabledHandler::Parse(Extension* extension, string16* error) {
39 DCHECK(extension->manifest()->HasKey(keys::kKioskEnabled)); 39 DCHECK(extension->manifest()->HasKey(keys::kKioskEnabled));
40 40
41 bool kiosk_enabled = false; 41 bool kiosk_enabled = false;
42 if (!extension->manifest()->GetBoolean(keys::kKioskEnabled, &kiosk_enabled)) { 42 if (!extension->manifest()->GetBoolean(keys::kKioskEnabled, &kiosk_enabled)) {
43 *error = ASCIIToUTF16(extension_manifest_errors::kInvalidKioskEnabled); 43 *error = ASCIIToUTF16(manifest_errors::kInvalidKioskEnabled);
44 return false; 44 return false;
45 } 45 }
46 46
47 // All other use cases should be already filtered out by manifest feature 47 // All other use cases should be already filtered out by manifest feature
48 // checks. 48 // checks.
49 DCHECK(extension->is_platform_app()); 49 DCHECK(extension->is_platform_app());
50 50
51 extension->SetManifestData(keys::kKioskEnabled, 51 extension->SetManifestData(keys::kKioskEnabled,
52 new KioskEnabledInfo(kiosk_enabled)); 52 new KioskEnabledInfo(kiosk_enabled));
53 return true; 53 return true;
54 } 54 }
55 55
56 const std::vector<std::string> KioskEnabledHandler::Keys() const { 56 const std::vector<std::string> KioskEnabledHandler::Keys() const {
57 return SingleKey(keys::kKioskEnabled); 57 return SingleKey(keys::kKioskEnabled);
58 } 58 }
59 59
60 } // namespace extensions 60 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698