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

Unified Diff: chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc

Issue 270973002: Don't start demo mode on a test image. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc
diff --git a/chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc
index d89958ae85ac28b56ea0784fb2501c961f383bf1..4881d5a3fd8e43f14a4cca0c3cd58e48495ce789 100644
--- a/chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc
@@ -16,6 +16,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/sys_info.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
@@ -165,6 +166,14 @@ void NetworkScreenHandler::Show() {
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableDemoMode))
return;
+ if (base::SysInfo::IsRunningOnChromeOS()) {
+ std::string track;
+ // We're running on an actual device; if we cannot find our release track
+ // value or if the track contains "testimage", don't start demo mode.
+ if (!base::SysInfo::GetLsbReleaseValue("CHROMEOS_RELEASE_TRACK", &track) ||
xiyuan 2014/05/09 01:08:17 nit: combine this and command line check into a he
rkc 2014/05/09 04:44:55 I would like to keep these here since there is vir
+ track.find("testimage") != std::string::npos)
+ return;
+ }
if (IsDerelict())
StartIdleDetection();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698