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/login/screens/network_screen.h" | 5 #include "chrome/browser/chromeos/login/screens/network_screen.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
14 #include "chrome/browser/chromeos/base/locale_util.h" | 14 #include "chrome/browser/chromeos/base/locale_util.h" |
15 #include "chrome/browser/chromeos/customization/customization_document.h" | 15 #include "chrome/browser/chromeos/customization/customization_document.h" |
16 #include "chrome/browser/chromeos/login/help_app_launcher.h" | 16 #include "chrome/browser/chromeos/login/help_app_launcher.h" |
17 #include "chrome/browser/chromeos/login/helper.h" | 17 #include "chrome/browser/chromeos/login/helper.h" |
18 #include "chrome/browser/chromeos/login/screen_manager.h" | 18 #include "chrome/browser/chromeos/login/screen_manager.h" |
19 #include "chrome/browser/chromeos/login/screens/base_screen_delegate.h" | 19 #include "chrome/browser/chromeos/login/screens/base_screen_delegate.h" |
20 #include "chrome/browser/chromeos/login/screens/network_view.h" | 20 #include "chrome/browser/chromeos/login/screens/network_view.h" |
21 #include "chrome/browser/chromeos/login/ui/input_events_blocker.h" | 21 #include "chrome/browser/chromeos/login/ui/input_events_blocker.h" |
22 #include "chrome/browser/chromeos/login/wizard_controller.h" | 22 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 23 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" |
23 #include "chrome/browser/profiles/profile_manager.h" | 24 #include "chrome/browser/profiles/profile_manager.h" |
24 #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h" | 25 #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h" |
25 #include "chrome/common/pref_names.h" | 26 #include "chrome/common/pref_names.h" |
26 #include "chrome/grit/chromium_strings.h" | 27 #include "chrome/grit/chromium_strings.h" |
27 #include "chrome/grit/generated_resources.h" | 28 #include "chrome/grit/generated_resources.h" |
28 #include "chromeos/network/network_handler.h" | 29 #include "chromeos/network/network_handler.h" |
29 #include "chromeos/network/network_state_handler.h" | 30 #include "chromeos/network/network_state_handler.h" |
30 #include "components/prefs/pref_service.h" | 31 #include "components/prefs/pref_service.h" |
31 #include "content/public/browser/browser_thread.h" | 32 #include "content/public/browser/browser_thread.h" |
32 #include "ui/base/l10n/l10n_util.h" | 33 #include "ui/base/l10n/l10n_util.h" |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 connection_timer_.Stop(); | 356 connection_timer_.Stop(); |
356 | 357 |
357 network_id_ = network_id; | 358 network_id_ = network_id; |
358 if (view_) | 359 if (view_) |
359 view_->ShowConnectingStatus(false, network_id_); | 360 view_->ShowConnectingStatus(false, network_id_); |
360 | 361 |
361 GetContextEditor().SetBoolean(kContextKeyContinueButtonEnabled, is_connected); | 362 GetContextEditor().SetBoolean(kContextKeyContinueButtonEnabled, is_connected); |
362 | 363 |
363 // Automatically continue if we are using Hands-Off Enrollment. | 364 // Automatically continue if we are using Hands-Off Enrollment. |
364 if (is_connected && continue_attempts_ == 0 && | 365 if (is_connected && continue_attempts_ == 0 && |
365 WizardController::UsingHandsOffEnrollment()) { | 366 policy::DeviceCloudPolicyManagerChromeOS::GetZeroTouchEnrollmentMode() == |
| 367 policy::ZeroTouchEnrollmentMode::HANDS_OFF) { |
366 OnContinueButtonPressed(); | 368 OnContinueButtonPressed(); |
367 } | 369 } |
368 } | 370 } |
369 | 371 |
370 void NetworkScreen::WaitForConnection(const base::string16& network_id) { | 372 void NetworkScreen::WaitForConnection(const base::string16& network_id) { |
371 if (network_id_ != network_id || !connection_timer_.IsRunning()) { | 373 if (network_id_ != network_id || !connection_timer_.IsRunning()) { |
372 connection_timer_.Stop(); | 374 connection_timer_.Stop(); |
373 connection_timer_.Start(FROM_HERE, | 375 connection_timer_.Start(FROM_HERE, |
374 base::TimeDelta::FromSeconds(kConnectionTimeoutSec), | 376 base::TimeDelta::FromSeconds(kConnectionTimeoutSec), |
375 this, | 377 this, |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 observer.OnLanguageListReloaded(); | 443 observer.OnLanguageListReloaded(); |
442 } | 444 } |
443 | 445 |
444 void NetworkScreen::OnSystemTimezoneChanged() { | 446 void NetworkScreen::OnSystemTimezoneChanged() { |
445 std::string current_timezone_id; | 447 std::string current_timezone_id; |
446 CrosSettings::Get()->GetString(kSystemTimezone, ¤t_timezone_id); | 448 CrosSettings::Get()->GetString(kSystemTimezone, ¤t_timezone_id); |
447 GetContextEditor().SetString(kContextKeyTimezone, current_timezone_id); | 449 GetContextEditor().SetString(kContextKeyTimezone, current_timezone_id); |
448 } | 450 } |
449 | 451 |
450 } // namespace chromeos | 452 } // namespace chromeos |
OLD | NEW |