| 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/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "ui/base/webui/web_ui_util.h" | 25 #include "ui/base/webui/web_ui_util.h" |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 const char kJsScreenPath[] = "login.AutolaunchScreen"; | 29 const char kJsScreenPath[] = "login.AutolaunchScreen"; |
| 30 | 30 |
| 31 } // namespace | 31 } // namespace |
| 32 | 32 |
| 33 namespace chromeos { | 33 namespace chromeos { |
| 34 | 34 |
| 35 KioskAutolaunchScreenHandler::KioskAutolaunchScreenHandler() { | 35 KioskAutolaunchScreenHandler::KioskAutolaunchScreenHandler() |
| 36 : BaseScreenHandler(kScreenId) { |
| 36 set_call_js_prefix(kJsScreenPath); | 37 set_call_js_prefix(kJsScreenPath); |
| 37 KioskAppManager::Get()->AddObserver(this); | 38 KioskAppManager::Get()->AddObserver(this); |
| 38 } | 39 } |
| 39 | 40 |
| 40 KioskAutolaunchScreenHandler::~KioskAutolaunchScreenHandler() { | 41 KioskAutolaunchScreenHandler::~KioskAutolaunchScreenHandler() { |
| 41 if (delegate_) | 42 if (delegate_) |
| 42 delegate_->OnViewDestroyed(this); | 43 delegate_->OnViewDestroyed(this); |
| 43 | 44 |
| 44 KioskAppManager::Get()->RemoveObserver(this); | 45 KioskAppManager::Get()->RemoveObserver(this); |
| 45 } | 46 } |
| 46 | 47 |
| 47 void KioskAutolaunchScreenHandler::Show() { | 48 void KioskAutolaunchScreenHandler::Show() { |
| 48 if (!page_is_ready()) { | 49 if (!page_is_ready()) { |
| 49 show_on_init_ = true; | 50 show_on_init_ = true; |
| 50 return; | 51 return; |
| 51 } | 52 } |
| 52 UpdateKioskApp(); | 53 UpdateKioskApp(); |
| 53 ShowScreen(OobeScreen::SCREEN_KIOSK_AUTOLAUNCH); | 54 ShowScreen(kScreenId); |
| 54 } | 55 } |
| 55 | 56 |
| 56 void KioskAutolaunchScreenHandler::SetDelegate(Delegate* delegate) { | 57 void KioskAutolaunchScreenHandler::SetDelegate(Delegate* delegate) { |
| 57 delegate_ = delegate; | 58 delegate_ = delegate; |
| 58 if (page_is_ready()) | 59 if (page_is_ready()) |
| 59 Initialize(); | 60 Initialize(); |
| 60 } | 61 } |
| 61 | 62 |
| 62 void KioskAutolaunchScreenHandler::UpdateKioskApp() { | 63 void KioskAutolaunchScreenHandler::UpdateKioskApp() { |
| 63 if (!is_visible_) | 64 if (!is_visible_) |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 void KioskAutolaunchScreenHandler::OnKioskAppsSettingsChanged() { | 151 void KioskAutolaunchScreenHandler::OnKioskAppsSettingsChanged() { |
| 151 UpdateKioskApp(); | 152 UpdateKioskApp(); |
| 152 } | 153 } |
| 153 | 154 |
| 154 void KioskAutolaunchScreenHandler::OnKioskAppDataChanged( | 155 void KioskAutolaunchScreenHandler::OnKioskAppDataChanged( |
| 155 const std::string& app_id) { | 156 const std::string& app_id) { |
| 156 UpdateKioskApp(); | 157 UpdateKioskApp(); |
| 157 } | 158 } |
| 158 | 159 |
| 159 } // namespace chromeos | 160 } // namespace chromeos |
| OLD | NEW |