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

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/hid_detection_screen_handler.cc

Issue 514273003: Check for channel and flag before allowing demo mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/ui/webui/chromeos/login/hid_detection_screen_handler.h" 5 #include "chrome/browser/ui/webui/chromeos/login/hid_detection_screen_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 105
106 void HIDDetectionScreenHandler::FindDevicesError() { 106 void HIDDetectionScreenHandler::FindDevicesError() {
107 VLOG(1) << "Failed to start Bluetooth discovery."; 107 VLOG(1) << "Failed to start Bluetooth discovery.";
108 } 108 }
109 109
110 void HIDDetectionScreenHandler::Show() { 110 void HIDDetectionScreenHandler::Show() {
111 if (!page_is_ready()) { 111 if (!page_is_ready()) {
112 show_on_init_ = true; 112 show_on_init_ = true;
113 return; 113 return;
114 } 114 }
115 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableDemoMode)) 115 core_oobe_actor_->InitDemoModeDetection();
116 core_oobe_actor_->InitDemoModeDetection();
117 input_service_proxy_.AddObserver(this); 116 input_service_proxy_.AddObserver(this);
118 UpdateDevices(); 117 UpdateDevices();
119 118
120 PrefService* local_state = g_browser_process->local_state(); 119 PrefService* local_state = g_browser_process->local_state();
121 int num_of_times_dialog_was_shown = local_state->GetInteger( 120 int num_of_times_dialog_was_shown = local_state->GetInteger(
122 prefs::kTimesHIDDialogShown); 121 prefs::kTimesHIDDialogShown);
123 local_state->SetInteger(prefs::kTimesHIDDialogShown, 122 local_state->SetInteger(prefs::kTimesHIDDialogShown,
124 num_of_times_dialog_was_shown + 1); 123 num_of_times_dialog_was_shown + 1);
125 124
126 ShowScreen(OobeUI::kScreenHIDDetection, NULL); 125 ShowScreen(OobeUI::kScreenHIDDetection, NULL);
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 l10n_util::GetStringFUTF16( 581 l10n_util::GetStringFUTF16(
583 IDS_HID_DETECTION_PAIRED_BLUETOOTH_KEYBOARD, 582 IDS_HID_DETECTION_PAIRED_BLUETOOTH_KEYBOARD,
584 base::UTF8ToUTF16(keyboard_device_name_))); 583 base::UTF8ToUTF16(keyboard_device_name_)));
585 } else { 584 } else {
586 state_info.SetString("state", kUSBConnectedState); 585 state_info.SetString("state", kUSBConnectedState);
587 } 586 }
588 CallJS("setKeyboardDeviceState", state_info); 587 CallJS("setKeyboardDeviceState", state_info);
589 } 588 }
590 589
591 } // namespace chromeos 590 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698