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

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

Issue 23588009: Parse /etc/lsb-release only once on ChromeOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 2 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 | 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/info_private_api.h" 5 #include "chrome/browser/chromeos/extensions/info_private_api.h"
6 6
7 #include "base/sys_info.h"
7 #include "base/values.h" 8 #include "base/values.h"
8 #include "chrome/browser/chromeos/login/startup_utils.h" 9 #include "chrome/browser/chromeos/login/startup_utils.h"
9 #include "chrome/browser/chromeos/login/user_manager.h" 10 #include "chrome/browser/chromeos/login/user_manager.h"
10 #include "chrome/browser/chromeos/system/statistics_provider.h" 11 #include "chrome/browser/chromeos/system/statistics_provider.h"
11 #include "chromeos/network/device_state.h" 12 #include "chromeos/network/device_state.h"
12 #include "chromeos/network/network_handler.h" 13 #include "chromeos/network/network_handler.h"
13 #include "chromeos/network/network_state_handler.h" 14 #include "chromeos/network/network_state_handler.h"
14 #include "chromeos/network/shill_property_util.h" 15 #include "chromeos/network/shill_property_util.h"
15 #include "third_party/cros_system_api/dbus/service_constants.h" 16 #include "third_party/cros_system_api/dbus/service_constants.h"
16 17
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 NetworkHandler::Get()->network_state_handler()->GetDeviceStateByType( 73 NetworkHandler::Get()->network_state_handler()->GetDeviceStateByType(
73 chromeos::NetworkTypePattern::Cellular()); 74 chromeos::NetworkTypePattern::Cellular());
74 std::string home_provider_id; 75 std::string home_provider_id;
75 if (cellular_device) 76 if (cellular_device)
76 home_provider_id = cellular_device->home_provider_id(); 77 home_provider_id = cellular_device->home_provider_id();
77 return new base::StringValue(home_provider_id); 78 return new base::StringValue(home_provider_id);
78 } else if (property_name == kPropertyInitialLocale) { 79 } else if (property_name == kPropertyInitialLocale) {
79 return new base::StringValue( 80 return new base::StringValue(
80 chromeos::StartupUtils::GetInitialLocale()); 81 chromeos::StartupUtils::GetInitialLocale());
81 } else if (property_name == kPropertyBoard) { 82 } else if (property_name == kPropertyBoard) {
82 std::string board; 83 return new base::StringValue(base::SysInfo::GetLsbReleaseBoard());
83 chromeos::system::StatisticsProvider* provider =
84 chromeos::system::StatisticsProvider::GetInstance();
85 provider->GetMachineStatistic(chromeos::system::kMachineInfoBoard, &board);
86 return new base::StringValue(board);
87 } else if (property_name == kPropertyOwner) { 84 } else if (property_name == kPropertyOwner) {
88 return Value::CreateBooleanValue( 85 return Value::CreateBooleanValue(
89 chromeos::UserManager::Get()->IsCurrentUserOwner()); 86 chromeos::UserManager::Get()->IsCurrentUserOwner());
90 } 87 }
91 88
92 DLOG(ERROR) << "Unknown property request: " << property_name; 89 DLOG(ERROR) << "Unknown property request: " << property_name;
93 return NULL; 90 return NULL;
94 } 91 }
95 92
96 } // namespace extensions 93 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/extensions/file_manager/private_api_strings.cc ('k') | chrome/browser/chromeos/external_metrics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698