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

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

Issue 872633008: Migrate (Network)ErrorScreen to ScreenContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 5 years, 10 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/kiosk_app_menu_handler.h" 5 #include "chrome/browser/ui/webui/chromeos/login/kiosk_app_menu_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/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/sys_info.h" 10 #include "base/sys_info.h"
11 #include "base/values.h" 11 #include "base/values.h"
12 #include "chrome/browser/browser_process.h" 12 #include "chrome/browser/browser_process.h"
13 #include "chrome/browser/chrome_notification_types.h" 13 #include "chrome/browser/chrome_notification_types.h"
14 #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h" 14 #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h"
15 #include "chrome/browser/chromeos/login/existing_user_controller.h" 15 #include "chrome/browser/chromeos/login/existing_user_controller.h"
16 #include "chrome/browser/chromeos/login/screens/network_error.h"
16 #include "chrome/grit/generated_resources.h" 17 #include "chrome/grit/generated_resources.h"
17 #include "chromeos/chromeos_switches.h" 18 #include "chromeos/chromeos_switches.h"
18 #include "content/public/browser/notification_details.h" 19 #include "content/public/browser/notification_details.h"
19 #include "content/public/browser/notification_service.h" 20 #include "content/public/browser/notification_service.h"
20 #include "content/public/browser/web_ui.h" 21 #include "content/public/browser/web_ui.h"
21 #include "ui/base/l10n/l10n_util.h" 22 #include "ui/base/l10n/l10n_util.h"
22 #include "ui/base/webui/web_ui_util.h" 23 #include "ui/base/webui/web_ui_util.h"
23 24
24 namespace chromeos { 25 namespace chromeos {
25 26
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 113
113 web_ui()->CallJavascriptFunction(EnableNewKioskUI() ? 114 web_ui()->CallJavascriptFunction(EnableNewKioskUI() ?
114 kKioskSetAppsNewAPI : kKioskSetAppsOldAPI, 115 kKioskSetAppsNewAPI : kKioskSetAppsOldAPI,
115 apps_list); 116 apps_list);
116 } 117 }
117 118
118 void KioskAppMenuHandler::HandleInitializeKioskApps( 119 void KioskAppMenuHandler::HandleInitializeKioskApps(
119 const base::ListValue* args) { 120 const base::ListValue* args) {
120 is_webui_initialized_ = true; 121 is_webui_initialized_ = true;
121 SendKioskApps(); 122 SendKioskApps();
122 UpdateState(ErrorScreenActor::ERROR_REASON_UPDATE); 123 UpdateState(NetworkError::ERROR_REASON_UPDATE);
123 } 124 }
124 125
125 void KioskAppMenuHandler::HandleKioskAppsLoaded( 126 void KioskAppMenuHandler::HandleKioskAppsLoaded(
126 const base::ListValue* args) { 127 const base::ListValue* args) {
127 content::NotificationService::current()->Notify( 128 content::NotificationService::current()->Notify(
128 chrome::NOTIFICATION_KIOSK_APPS_LOADED, 129 chrome::NOTIFICATION_KIOSK_APPS_LOADED,
129 content::NotificationService::AllSources(), 130 content::NotificationService::AllSources(),
130 content::NotificationService::NoDetails()); 131 content::NotificationService::NoDetails());
131 } 132 }
132 133
(...skipping 12 matching lines...) Expand all
145 } 146 }
146 147
147 void KioskAppMenuHandler::OnKioskAppsSettingsChanged() { 148 void KioskAppMenuHandler::OnKioskAppsSettingsChanged() {
148 SendKioskApps(); 149 SendKioskApps();
149 } 150 }
150 151
151 void KioskAppMenuHandler::OnKioskAppDataChanged(const std::string& app_id) { 152 void KioskAppMenuHandler::OnKioskAppDataChanged(const std::string& app_id) {
152 SendKioskApps(); 153 SendKioskApps();
153 } 154 }
154 155
155 void KioskAppMenuHandler::UpdateState(ErrorScreenActor::ErrorReason reason) { 156 void KioskAppMenuHandler::UpdateState(NetworkError::ErrorReason reason) {
156 if (network_state_informer_->state() == NetworkStateInformer::ONLINE) 157 if (network_state_informer_->state() == NetworkStateInformer::ONLINE)
157 KioskAppManager::Get()->RetryFailedAppDataFetch(); 158 KioskAppManager::Get()->RetryFailedAppDataFetch();
158 } 159 }
159 160
160 } // namespace chromeos 161 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698