| 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_CHROMEOS_LOGIN_SCREENS_NETWORK_SCREEN_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_NETWORK_SCREEN_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_NETWORK_SCREEN_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_NETWORK_SCREEN_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 9 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 10 #include "base/macros.h" | 12 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 14 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
| 15 #include "base/strings/string16.h" | 16 #include "base/strings/string16.h" |
| 16 #include "base/timer/timer.h" | 17 #include "base/timer/timer.h" |
| 17 #include "chrome/browser/chromeos/login/screens/network_model.h" | 18 #include "chrome/browser/chromeos/login/screens/network_model.h" |
| 18 #include "chrome/browser/chromeos/settings/cros_settings.h" | 19 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 19 #include "chromeos/network/network_state_handler_observer.h" | 20 #include "chromeos/network/network_state_handler_observer.h" |
| 20 #include "ui/base/ime/chromeos/input_method_manager.h" | 21 #include "ui/base/ime/chromeos/input_method_manager.h" |
| 21 | 22 |
| 22 namespace chromeos { | 23 namespace chromeos { |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 void OnContinueButtonPressed(); | 147 void OnContinueButtonPressed(); |
| 147 | 148 |
| 148 // Async callback after ReloadResourceBundle(locale) completed. | 149 // Async callback after ReloadResourceBundle(locale) completed. |
| 149 void OnLanguageChangedCallback( | 150 void OnLanguageChangedCallback( |
| 150 const InputEventsBlocker* input_events_blocker, | 151 const InputEventsBlocker* input_events_blocker, |
| 151 const std::string& input_method, | 152 const std::string& input_method, |
| 152 const locale_util::LanguageSwitchResult& result); | 153 const locale_util::LanguageSwitchResult& result); |
| 153 | 154 |
| 154 // Starts resolving language list on BlockingPool. | 155 // Starts resolving language list on BlockingPool. |
| 155 void ScheduleResolveLanguageList( | 156 void ScheduleResolveLanguageList( |
| 156 scoped_ptr<locale_util::LanguageSwitchResult> language_switch_result); | 157 std::unique_ptr<locale_util::LanguageSwitchResult> |
| 158 language_switch_result); |
| 157 | 159 |
| 158 // Callback for chromeos::ResolveUILanguageList() (from l10n_util). | 160 // Callback for chromeos::ResolveUILanguageList() (from l10n_util). |
| 159 void OnLanguageListResolved(scoped_ptr<base::ListValue> new_language_list, | 161 void OnLanguageListResolved( |
| 160 const std::string& new_language_list_locale, | 162 std::unique_ptr<base::ListValue> new_language_list, |
| 161 const std::string& new_selected_language); | 163 const std::string& new_language_list_locale, |
| 164 const std::string& new_selected_language); |
| 162 | 165 |
| 163 // Callback when the system timezone settings is changed. | 166 // Callback when the system timezone settings is changed. |
| 164 void OnSystemTimezoneChanged(); | 167 void OnSystemTimezoneChanged(); |
| 165 | 168 |
| 166 // True if subscribed to network change notification. | 169 // True if subscribed to network change notification. |
| 167 bool is_network_subscribed_; | 170 bool is_network_subscribed_; |
| 168 | 171 |
| 169 // ID of the the network that we are waiting for. | 172 // ID of the the network that we are waiting for. |
| 170 base::string16 network_id_; | 173 base::string16 network_id_; |
| 171 | 174 |
| 172 // True if user pressed continue button so we should proceed with OOBE | 175 // True if user pressed continue button so we should proceed with OOBE |
| 173 // as soon as we are connected. | 176 // as soon as we are connected. |
| 174 bool continue_pressed_; | 177 bool continue_pressed_; |
| 175 | 178 |
| 176 // Timer for connection timeout. | 179 // Timer for connection timeout. |
| 177 base::OneShotTimer connection_timer_; | 180 base::OneShotTimer connection_timer_; |
| 178 | 181 |
| 179 scoped_ptr<CrosSettings::ObserverSubscription> timezone_subscription_; | 182 std::unique_ptr<CrosSettings::ObserverSubscription> timezone_subscription_; |
| 180 | 183 |
| 181 NetworkView* view_; | 184 NetworkView* view_; |
| 182 Delegate* delegate_; | 185 Delegate* delegate_; |
| 183 scoped_ptr<login::NetworkStateHelper> network_state_helper_; | 186 std::unique_ptr<login::NetworkStateHelper> network_state_helper_; |
| 184 | 187 |
| 185 std::string input_method_; | 188 std::string input_method_; |
| 186 std::string timezone_; | 189 std::string timezone_; |
| 187 | 190 |
| 188 // Creation of language list happens on Blocking Pool, so we cache | 191 // Creation of language list happens on Blocking Pool, so we cache |
| 189 // resolved data. | 192 // resolved data. |
| 190 std::string language_list_locale_; | 193 std::string language_list_locale_; |
| 191 scoped_ptr<base::ListValue> language_list_; | 194 std::unique_ptr<base::ListValue> language_list_; |
| 192 | 195 |
| 193 // The exact language code selected by user in the menu. | 196 // The exact language code selected by user in the menu. |
| 194 std::string selected_language_code_; | 197 std::string selected_language_code_; |
| 195 | 198 |
| 196 base::ObserverList<Observer> observers_; | 199 base::ObserverList<Observer> observers_; |
| 197 | 200 |
| 198 base::WeakPtrFactory<NetworkScreen> weak_factory_; | 201 base::WeakPtrFactory<NetworkScreen> weak_factory_; |
| 199 | 202 |
| 200 DISALLOW_COPY_AND_ASSIGN(NetworkScreen); | 203 DISALLOW_COPY_AND_ASSIGN(NetworkScreen); |
| 201 }; | 204 }; |
| 202 | 205 |
| 203 } // namespace chromeos | 206 } // namespace chromeos |
| 204 | 207 |
| 205 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_NETWORK_SCREEN_H_ | 208 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_NETWORK_SCREEN_H_ |
| OLD | NEW |