OLD | NEW |
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/mobile_config.h" | 5 #include "chrome/browser/chromeos/mobile_config.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 if (iter != deal->locales().end()) { | 187 if (iter != deal->locales().end()) { |
188 const std::string& deal_id = deal->deal_id(); | 188 const std::string& deal_id = deal->deal_id(); |
189 deals_[deal_id] = deal.release(); | 189 deals_[deal_id] = deal.release(); |
190 } | 190 } |
191 } | 191 } |
192 } | 192 } |
193 } | 193 } |
194 } | 194 } |
195 | 195 |
196 void MobileConfig::Carrier::RemoveDeals() { | 196 void MobileConfig::Carrier::RemoveDeals() { |
197 STLDeleteValues(&deals_); | 197 base::STLDeleteValues(&deals_); |
198 } | 198 } |
199 | 199 |
200 // MobileConfig::LocaleConfig implementation. ---------------------------------- | 200 // MobileConfig::LocaleConfig implementation. ---------------------------------- |
201 | 201 |
202 MobileConfig::LocaleConfig::LocaleConfig(base::DictionaryValue* locale_dict) { | 202 MobileConfig::LocaleConfig::LocaleConfig(base::DictionaryValue* locale_dict) { |
203 InitFromDictionary(locale_dict); | 203 InitFromDictionary(locale_dict); |
204 } | 204 } |
205 | 205 |
206 MobileConfig::LocaleConfig::~LocaleConfig() { | 206 MobileConfig::LocaleConfig::~LocaleConfig() { |
207 } | 207 } |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 } | 310 } |
311 | 311 |
312 MobileConfig::MobileConfig(const std::string& config, | 312 MobileConfig::MobileConfig(const std::string& config, |
313 const std::string& initial_locale) | 313 const std::string& initial_locale) |
314 : CustomizationDocument(kAcceptedConfigVersion), | 314 : CustomizationDocument(kAcceptedConfigVersion), |
315 initial_locale_(initial_locale) { | 315 initial_locale_(initial_locale) { |
316 LoadManifestFromString(config); | 316 LoadManifestFromString(config); |
317 } | 317 } |
318 | 318 |
319 MobileConfig::~MobileConfig() { | 319 MobileConfig::~MobileConfig() { |
320 STLDeleteValues(&carriers_); | 320 base::STLDeleteValues(&carriers_); |
321 } | 321 } |
322 | 322 |
323 void MobileConfig::LoadConfig() { | 323 void MobileConfig::LoadConfig() { |
324 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 324 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
325 base::Bind(&MobileConfig::ReadConfigInBackground, | 325 base::Bind(&MobileConfig::ReadConfigInBackground, |
326 base::Unretained(this), // this class is a singleton. | 326 base::Unretained(this), // this class is a singleton. |
327 base::FilePath(kGlobalCarrierConfigPath), | 327 base::FilePath(kGlobalCarrierConfigPath), |
328 base::FilePath(kLocalCarrierConfigPath))); | 328 base::FilePath(kLocalCarrierConfigPath))); |
329 } | 329 } |
330 | 330 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 << local_config_file.value(); | 369 << local_config_file.value(); |
370 } | 370 } |
371 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 371 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
372 base::Bind(&MobileConfig::ProcessConfig, | 372 base::Bind(&MobileConfig::ProcessConfig, |
373 base::Unretained(this), // singleton. | 373 base::Unretained(this), // singleton. |
374 global_config, | 374 global_config, |
375 local_config)); | 375 local_config)); |
376 } | 376 } |
377 | 377 |
378 } // namespace chromeos | 378 } // namespace chromeos |
OLD | NEW |