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

Side by Side Diff: chrome/browser/chromeos/extensions/echo_private_api.cc

Issue 11369258: Revert 167808 - Get rid of use of CreateStringValue in chromeos/ directory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser/chromeos/extensions/echo_private_api.h" 5 #include "chrome/browser/chromeos/extensions/echo_private_api.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 16 matching lines...) Expand all
27 chromeos::system::StatisticsProvider::GetInstance(); 27 chromeos::system::StatisticsProvider::GetInstance();
28 std::string result; 28 std::string result;
29 if (!chromeos::KioskModeSettings::Get()->IsKioskModeEnabled()) { 29 if (!chromeos::KioskModeSettings::Get()->IsKioskModeEnabled()) {
30 // In Kiosk mode, we effectively disable the registration API 30 // In Kiosk mode, we effectively disable the registration API
31 // by always returning an empty code. 31 // by always returning an empty code.
32 if (type == kCouponType) 32 if (type == kCouponType)
33 provider->GetMachineStatistic(kCouponCodeKey, &result); 33 provider->GetMachineStatistic(kCouponCodeKey, &result);
34 else if (type == kGroupType) 34 else if (type == kGroupType)
35 provider->GetMachineStatistic(kGroupCodeKey, &result); 35 provider->GetMachineStatistic(kGroupCodeKey, &result);
36 } 36 }
37 return new base::StringValue(result); 37 return Value::CreateStringValue(result);
38 } 38 }
39 39
40 } // namespace 40 } // namespace
41 41
42 42
43 GetRegistrationCodeFunction::GetRegistrationCodeFunction() { 43 GetRegistrationCodeFunction::GetRegistrationCodeFunction() {
44 } 44 }
45 45
46 GetRegistrationCodeFunction::~GetRegistrationCodeFunction() { 46 GetRegistrationCodeFunction::~GetRegistrationCodeFunction() {
47 } 47 }
48 48
49 bool GetRegistrationCodeFunction::RunImpl() { 49 bool GetRegistrationCodeFunction::RunImpl() {
50 std::string type; 50 std::string type;
51 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &type)); 51 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &type));
52 SetResult(GetValueForRegistrationCodeType(type)); 52 SetResult(GetValueForRegistrationCodeType(type));
53 return true; 53 return true;
54 } 54 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698