| OLD | NEW |
| 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_autolaunch_screen_handler
.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/kiosk_autolaunch_screen_handler
.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.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_manager.h" | 14 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
| 15 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
| 16 #include "chrome/grit/generated_resources.h" | 16 #include "chrome/grit/generated_resources.h" |
| 17 #include "chromeos/chromeos_switches.h" | 17 #include "chromeos/chromeos_switches.h" |
| 18 #include "chromeos/dbus/dbus_thread_manager.h" | 18 #include "chromeos/dbus/dbus_thread_manager.h" |
| 19 #include "chromeos/dbus/session_manager_client.h" | 19 #include "chromeos/dbus/session_manager_client.h" |
| 20 #include "components/login/localized_values_builder.h" |
| 20 #include "content/public/browser/notification_details.h" | 21 #include "content/public/browser/notification_details.h" |
| 21 #include "content/public/browser/notification_service.h" | 22 #include "content/public/browser/notification_service.h" |
| 22 #include "ui/base/webui/web_ui_util.h" | 23 #include "ui/base/webui/web_ui_util.h" |
| 23 | 24 |
| 24 namespace { | 25 namespace { |
| 25 | 26 |
| 26 const char kJsScreenPath[] = "login.AutolaunchScreen"; | 27 const char kJsScreenPath[] = "login.AutolaunchScreen"; |
| 27 | 28 |
| 28 // Autolaunch screen id. | 29 // Autolaunch screen id. |
| 29 const char kAutolaunchScreen[] = "autolaunch"; | 30 const char kAutolaunchScreen[] = "autolaunch"; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 81 |
| 81 std::string icon_url("chrome://theme/IDR_APP_DEFAULT_ICON"); | 82 std::string icon_url("chrome://theme/IDR_APP_DEFAULT_ICON"); |
| 82 if (!app.icon.isNull()) | 83 if (!app.icon.isNull()) |
| 83 icon_url = webui::GetBitmapDataUrl(*app.icon.bitmap()); | 84 icon_url = webui::GetBitmapDataUrl(*app.icon.bitmap()); |
| 84 | 85 |
| 85 app_info.SetString("appIconUrl", icon_url); | 86 app_info.SetString("appIconUrl", icon_url); |
| 86 CallJS("updateApp", app_info); | 87 CallJS("updateApp", app_info); |
| 87 } | 88 } |
| 88 | 89 |
| 89 void KioskAutolaunchScreenHandler::DeclareLocalizedValues( | 90 void KioskAutolaunchScreenHandler::DeclareLocalizedValues( |
| 90 LocalizedValuesBuilder* builder) { | 91 ::login::LocalizedValuesBuilder* builder) { |
| 91 builder->Add("autolaunchTitle", IDS_AUTOSTART_WARNING_TITLE); | 92 builder->Add("autolaunchTitle", IDS_AUTOSTART_WARNING_TITLE); |
| 92 builder->Add("autolaunchWarningTitle", IDS_AUTOSTART_WARNING_TITLE); | 93 builder->Add("autolaunchWarningTitle", IDS_AUTOSTART_WARNING_TITLE); |
| 93 builder->Add("autolaunchWarning", IDS_KIOSK_AUTOSTART_SCREEN_WARNING_MSG); | 94 builder->Add("autolaunchWarning", IDS_KIOSK_AUTOSTART_SCREEN_WARNING_MSG); |
| 94 builder->Add("autolaunchConfirmButton", IDS_KIOSK_AUTOSTART_CONFIRM); | 95 builder->Add("autolaunchConfirmButton", IDS_KIOSK_AUTOSTART_CONFIRM); |
| 95 builder->Add("autolaunchCancelButton", IDS_CANCEL); | 96 builder->Add("autolaunchCancelButton", IDS_CANCEL); |
| 96 } | 97 } |
| 97 | 98 |
| 98 void KioskAutolaunchScreenHandler::Initialize() { | 99 void KioskAutolaunchScreenHandler::Initialize() { |
| 99 if (!page_is_ready() || !delegate_) | 100 if (!page_is_ready() || !delegate_) |
| 100 return; | 101 return; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 void KioskAutolaunchScreenHandler::OnKioskAppsSettingsChanged() { | 154 void KioskAutolaunchScreenHandler::OnKioskAppsSettingsChanged() { |
| 154 UpdateKioskApp(); | 155 UpdateKioskApp(); |
| 155 } | 156 } |
| 156 | 157 |
| 157 void KioskAutolaunchScreenHandler::OnKioskAppDataChanged( | 158 void KioskAutolaunchScreenHandler::OnKioskAppDataChanged( |
| 158 const std::string& app_id) { | 159 const std::string& app_id) { |
| 159 UpdateKioskApp(); | 160 UpdateKioskApp(); |
| 160 } | 161 } |
| 161 | 162 |
| 162 } // namespace chromeos | 163 } // namespace chromeos |
| OLD | NEW |