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/ui/webui/chromeos/login/update_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/update_screen_handler.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/chromeos/login/screens/update_model.h" | 9 #include "chrome/browser/chromeos/login/screens/update_model.h" |
10 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 10 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
11 #include "chrome/grit/chromium_strings.h" | 11 #include "chrome/grit/chromium_strings.h" |
12 #include "chrome/grit/generated_resources.h" | 12 #include "chrome/grit/generated_resources.h" |
| 13 #include "components/login/localized_values_builder.h" |
13 #include "ui/base/l10n/l10n_util.h" | 14 #include "ui/base/l10n/l10n_util.h" |
14 | 15 |
15 namespace { | 16 namespace { |
16 | 17 |
17 const char kJsScreenPath[] = "login.UpdateScreen"; | 18 const char kJsScreenPath[] = "login.UpdateScreen"; |
18 | 19 |
19 } // namespace | 20 } // namespace |
20 | 21 |
21 namespace chromeos { | 22 namespace chromeos { |
22 | 23 |
23 UpdateScreenHandler::UpdateScreenHandler() | 24 UpdateScreenHandler::UpdateScreenHandler() |
24 : BaseScreenHandler(kJsScreenPath), model_(nullptr), show_on_init_(false) { | 25 : BaseScreenHandler(kJsScreenPath), model_(nullptr), show_on_init_(false) { |
25 } | 26 } |
26 | 27 |
27 UpdateScreenHandler::~UpdateScreenHandler() { | 28 UpdateScreenHandler::~UpdateScreenHandler() { |
28 if (model_) | 29 if (model_) |
29 model_->OnViewDestroyed(this); | 30 model_->OnViewDestroyed(this); |
30 } | 31 } |
31 | 32 |
32 void UpdateScreenHandler::DeclareLocalizedValues( | 33 void UpdateScreenHandler::DeclareLocalizedValues( |
33 LocalizedValuesBuilder* builder) { | 34 ::login::LocalizedValuesBuilder* builder) { |
34 builder->Add("checkingForUpdatesMsg", IDS_CHECKING_FOR_UPDATE_MSG); | 35 builder->Add("checkingForUpdatesMsg", IDS_CHECKING_FOR_UPDATE_MSG); |
35 builder->Add("installingUpdateDesc", IDS_UPDATE_MSG); | 36 builder->Add("installingUpdateDesc", IDS_UPDATE_MSG); |
36 builder->Add("updateScreenTitle", IDS_UPDATE_SCREEN_TITLE); | 37 builder->Add("updateScreenTitle", IDS_UPDATE_SCREEN_TITLE); |
37 builder->Add("updateScreenAccessibleTitle", | 38 builder->Add("updateScreenAccessibleTitle", |
38 IDS_UPDATE_SCREEN_ACCESSIBLE_TITLE); | 39 IDS_UPDATE_SCREEN_ACCESSIBLE_TITLE); |
39 builder->Add("checkingForUpdates", IDS_CHECKING_FOR_UPDATES); | 40 builder->Add("checkingForUpdates", IDS_CHECKING_FOR_UPDATES); |
40 builder->Add("downloading", IDS_DOWNLOADING); | 41 builder->Add("downloading", IDS_DOWNLOADING); |
41 builder->Add("downloadingTimeLeftLong", IDS_DOWNLOADING_TIME_LEFT_LONG); | 42 builder->Add("downloadingTimeLeftLong", IDS_DOWNLOADING_TIME_LEFT_LONG); |
42 builder->Add("downloadingTimeLeftStatusOneHour", | 43 builder->Add("downloadingTimeLeftStatusOneHour", |
43 IDS_DOWNLOADING_TIME_LEFT_STATUS_ONE_HOUR); | 44 IDS_DOWNLOADING_TIME_LEFT_STATUS_ONE_HOUR); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 model_ = nullptr; | 85 model_ = nullptr; |
85 BaseScreenHandler::SetBaseScreen(nullptr); | 86 BaseScreenHandler::SetBaseScreen(nullptr); |
86 } | 87 } |
87 | 88 |
88 void UpdateScreenHandler::OnConnectToNetworkRequested() { | 89 void UpdateScreenHandler::OnConnectToNetworkRequested() { |
89 if (model_) | 90 if (model_) |
90 model_->OnConnectToNetworkRequested(); | 91 model_->OnConnectToNetworkRequested(); |
91 } | 92 } |
92 | 93 |
93 } // namespace chromeos | 94 } // namespace chromeos |
OLD | NEW |