| 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 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_SCREEN_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_SCREEN_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_SCREEN_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_SCREEN_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/time/time.h" | |
| 13 #include "base/timer/timer.h" | |
| 14 #include "chrome/browser/chromeos/login/screens/network_screen_actor.h" | 12 #include "chrome/browser/chromeos/login/screens/network_screen_actor.h" |
| 15 #include "chrome/browser/chromeos/settings/cros_settings.h" | 13 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 16 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" | 14 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" |
| 17 #include "chromeos/ime/component_extension_ime_manager.h" | 15 #include "chromeos/ime/component_extension_ime_manager.h" |
| 18 #include "chromeos/ime/input_method_manager.h" | 16 #include "chromeos/ime/input_method_manager.h" |
| 19 #include "ui/gfx/point.h" | 17 #include "ui/gfx/point.h" |
| 20 | 18 |
| 21 class PrefRegistrySimple; | 19 class PrefRegistrySimple; |
| 22 | 20 |
| 23 namespace chromeos { | 21 namespace chromeos { |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 83 |
| 86 // Handles change of the input method. | 84 // Handles change of the input method. |
| 87 void HandleOnInputMethodChanged(const std::string& id); | 85 void HandleOnInputMethodChanged(const std::string& id); |
| 88 | 86 |
| 89 // Handles change of the time zone | 87 // Handles change of the time zone |
| 90 void HandleOnTimezoneChanged(const std::string& timezone); | 88 void HandleOnTimezoneChanged(const std::string& timezone); |
| 91 | 89 |
| 92 // Callback when the system timezone settings is changed. | 90 // Callback when the system timezone settings is changed. |
| 93 void OnSystemTimezoneChanged(); | 91 void OnSystemTimezoneChanged(); |
| 94 | 92 |
| 95 // Demo mode detection methods. | |
| 96 void StartIdleDetection(); | |
| 97 void StartOobeTimer(); | |
| 98 void OnIdle(); | |
| 99 void OnOobeTimerUpdate(); | |
| 100 void SetupTimeouts(); | |
| 101 bool IsDerelict(); | |
| 102 | |
| 103 // Returns available languages. Caller gets the ownership. Note, it does | 93 // Returns available languages. Caller gets the ownership. Note, it does |
| 104 // depend on the current locale. | 94 // depend on the current locale. |
| 105 base::ListValue* GetLanguageList(); | 95 base::ListValue* GetLanguageList(); |
| 106 | 96 |
| 107 // Returns available input methods. Caller gets the ownership. Note, it does | 97 // Returns available input methods. Caller gets the ownership. Note, it does |
| 108 // depend on the current locale. | 98 // depend on the current locale. |
| 109 static base::ListValue* GetInputMethods(); | 99 static base::ListValue* GetInputMethods(); |
| 110 | 100 |
| 111 // Returns available timezones. Caller gets the ownership. | 101 // Returns available timezones. Caller gets the ownership. |
| 112 static base::ListValue* GetTimezoneList(); | 102 static base::ListValue* GetTimezoneList(); |
| 113 | 103 |
| 114 NetworkScreenActor::Delegate* screen_; | 104 NetworkScreenActor::Delegate* screen_; |
| 115 CoreOobeActor* core_oobe_actor_; | 105 CoreOobeActor* core_oobe_actor_; |
| 116 | 106 |
| 117 bool is_continue_enabled_; | 107 bool is_continue_enabled_; |
| 118 | 108 |
| 119 // Total time this machine has spent on OOBE. | |
| 120 base::TimeDelta time_on_oobe_; | |
| 121 | |
| 122 // Keeps whether screen should be shown right after initialization. | 109 // Keeps whether screen should be shown right after initialization. |
| 123 bool show_on_init_; | 110 bool show_on_init_; |
| 124 | 111 |
| 125 // Position of the network control. | 112 // Position of the network control. |
| 126 gfx::Point network_control_pos_; | 113 gfx::Point network_control_pos_; |
| 127 | 114 |
| 128 scoped_ptr<CrosSettings::ObserverSubscription> timezone_subscription_; | 115 scoped_ptr<CrosSettings::ObserverSubscription> timezone_subscription_; |
| 129 | 116 |
| 130 scoped_ptr<IdleDetector> idle_detector_; | |
| 131 | |
| 132 base::RepeatingTimer<NetworkScreenHandler> oobe_timer_; | |
| 133 | |
| 134 // Timeout to detect if the machine is in a derelict state. | |
| 135 base::TimeDelta derelict_detection_timeout_; | |
| 136 | |
| 137 // Timeout before showing our demo app if the machine is in a derelict state. | |
| 138 base::TimeDelta derelict_idle_timeout_; | |
| 139 | |
| 140 // Time between updating our total time on oobe. | |
| 141 base::TimeDelta oobe_timer_update_interval_; | |
| 142 | |
| 143 // True if should reinitialize language and keyboard list once the page | 117 // True if should reinitialize language and keyboard list once the page |
| 144 // is ready. | 118 // is ready. |
| 145 bool should_reinitialize_language_keyboard_list_; | 119 bool should_reinitialize_language_keyboard_list_; |
| 146 | 120 |
| 147 // The exact language code selected by user in the menu. | 121 // The exact language code selected by user in the menu. |
| 148 std::string selected_language_code_; | 122 std::string selected_language_code_; |
| 149 | 123 |
| 150 base::WeakPtrFactory<NetworkScreenHandler> weak_ptr_factory_; | 124 base::WeakPtrFactory<NetworkScreenHandler> weak_ptr_factory_; |
| 151 | 125 |
| 152 DISALLOW_COPY_AND_ASSIGN(NetworkScreenHandler); | 126 DISALLOW_COPY_AND_ASSIGN(NetworkScreenHandler); |
| 153 }; | 127 }; |
| 154 | 128 |
| 155 } // namespace chromeos | 129 } // namespace chromeos |
| 156 | 130 |
| 157 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_SCREEN_HANDLER_H_ | 131 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_SCREEN_HANDLER_H_ |
| OLD | NEW |