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

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

Issue 1150863002: Make DictionaryValue::DeepCopyWithoutEmptyChildren return a scoped_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove semicolons Created 5 years, 7 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
« no previous file with comments | « base/values_unittest.cc ('k') | chrome/browser/prefs/tracked/pref_hash_calculator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 EchoPrivateSetOfferInfoFunction::EchoPrivateSetOfferInfoFunction() {} 90 EchoPrivateSetOfferInfoFunction::EchoPrivateSetOfferInfoFunction() {}
91 91
92 EchoPrivateSetOfferInfoFunction::~EchoPrivateSetOfferInfoFunction() {} 92 EchoPrivateSetOfferInfoFunction::~EchoPrivateSetOfferInfoFunction() {}
93 93
94 bool EchoPrivateSetOfferInfoFunction::RunSync() { 94 bool EchoPrivateSetOfferInfoFunction::RunSync() {
95 scoped_ptr<echo_api::SetOfferInfo::Params> params = 95 scoped_ptr<echo_api::SetOfferInfo::Params> params =
96 echo_api::SetOfferInfo::Params::Create(*args_); 96 echo_api::SetOfferInfo::Params::Create(*args_);
97 EXTENSION_FUNCTION_VALIDATE(params); 97 EXTENSION_FUNCTION_VALIDATE(params);
98 98
99 const std::string& service_id = params->id; 99 const std::string& service_id = params->id;
100 base::DictionaryValue* dict = params->offer_info. 100 scoped_ptr<base::DictionaryValue> dict =
101 additional_properties.DeepCopyWithoutEmptyChildren(); 101 params->offer_info.additional_properties.DeepCopyWithoutEmptyChildren();
102 102
103 PrefService* local_state = g_browser_process->local_state(); 103 PrefService* local_state = g_browser_process->local_state();
104 DictionaryPrefUpdate offer_update(local_state, prefs::kEchoCheckedOffers); 104 DictionaryPrefUpdate offer_update(local_state, prefs::kEchoCheckedOffers);
105 offer_update->SetWithoutPathExpansion("echo." + service_id, dict); 105 offer_update->SetWithoutPathExpansion("echo." + service_id, dict.Pass());
106 return true; 106 return true;
107 } 107 }
108 108
109 EchoPrivateGetOfferInfoFunction::EchoPrivateGetOfferInfoFunction() {} 109 EchoPrivateGetOfferInfoFunction::EchoPrivateGetOfferInfoFunction() {}
110 110
111 EchoPrivateGetOfferInfoFunction::~EchoPrivateGetOfferInfoFunction() {} 111 EchoPrivateGetOfferInfoFunction::~EchoPrivateGetOfferInfoFunction() {}
112 112
113 bool EchoPrivateGetOfferInfoFunction::RunSync() { 113 bool EchoPrivateGetOfferInfoFunction::RunSync() {
114 scoped_ptr<echo_api::GetOfferInfo::Params> params = 114 scoped_ptr<echo_api::GetOfferInfo::Params> params =
115 echo_api::GetOfferInfo::Params::Create(*args_); 115 echo_api::GetOfferInfo::Params::Create(*args_);
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 void EchoPrivateGetUserConsentFunction::Finalize(bool consent) { 270 void EchoPrivateGetUserConsentFunction::Finalize(bool consent) {
271 // Consent should not be true if offers redeeming is disabled. 271 // Consent should not be true if offers redeeming is disabled.
272 CHECK(redeem_offers_allowed_ || !consent); 272 CHECK(redeem_offers_allowed_ || !consent);
273 results_ = echo_api::GetUserConsent::Results::Create(consent); 273 results_ = echo_api::GetUserConsent::Results::Create(consent);
274 SendResponse(true); 274 SendResponse(true);
275 275
276 // Release the reference added in |OnRedeemOffersAllowedChecked|, before 276 // Release the reference added in |OnRedeemOffersAllowedChecked|, before
277 // showing the dialog. 277 // showing the dialog.
278 Release(); 278 Release();
279 } 279 }
OLDNEW
« no previous file with comments | « base/values_unittest.cc ('k') | chrome/browser/prefs/tracked/pref_hash_calculator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698