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

Side by Side Diff: chrome/browser/extensions/extension_info_private_api_chromeos.cc

Issue 8588006: Eliminate CrosLibrary::EnsureLoaded (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 9 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/extensions/extension_info_private_api_chromeos.h" 5 #include "chrome/browser/extensions/extension_info_private_api_chromeos.h"
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "chrome/browser/chromeos/cros/cros_library.h" 8 #include "chrome/browser/chromeos/cros/cros_library.h"
9 #include "chrome/browser/chromeos/cros/network_library.h" 9 #include "chrome/browser/chromeos/cros/network_library.h"
10 #include "chrome/browser/chromeos/login/wizard_controller.h" 10 #include "chrome/browser/chromeos/login/wizard_controller.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 } 52 }
53 53
54 bool GetChromeosInfoFunction::GetValue(const std::string& property_name, 54 bool GetChromeosInfoFunction::GetValue(const std::string& property_name,
55 std::string* value) { 55 std::string* value) {
56 value->clear(); 56 value->clear();
57 if (property_name == kPropertyHWID) { 57 if (property_name == kPropertyHWID) {
58 chromeos::system::StatisticsProvider* provider = 58 chromeos::system::StatisticsProvider* provider =
59 chromeos::system::StatisticsProvider::GetInstance(); 59 chromeos::system::StatisticsProvider::GetInstance();
60 provider->GetMachineStatistic(kHardwareClass, value); 60 provider->GetMachineStatistic(kHardwareClass, value);
61 } else if (property_name == kPropertyHomeProvider) { 61 } else if (property_name == kPropertyHomeProvider) {
62 if (CrosLibrary::Get()->EnsureLoaded()) { 62 NetworkLibrary* netlib = CrosLibrary::Get()->GetNetworkLibrary();
63 NetworkLibrary* netlib = CrosLibrary::Get()->GetNetworkLibrary(); 63 (*value) = netlib->GetCellularHomeCarrierId();
64 (*value) = netlib->GetCellularHomeCarrierId();
65 } else {
66 LOG(ERROR) << "CrosLibrary can't be loaded.";
67 }
68 } else if (property_name == kPropertyInitialLocale) { 64 } else if (property_name == kPropertyInitialLocale) {
69 *value = chromeos::WizardController::GetInitialLocale(); 65 *value = chromeos::WizardController::GetInitialLocale();
70 } else { 66 } else {
71 LOG(ERROR) << "Unknown property request: " << property_name; 67 LOG(ERROR) << "Unknown property request: " << property_name;
72 return false; 68 return false;
73 } 69 }
74 return true; 70 return true;
75 } 71 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/user_cros_settings_provider.cc ('k') | chrome/browser/geolocation/wifi_data_provider_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698