| 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_enable_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/kiosk_enable_screen_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| 11 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 11 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 12 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
| 13 #include "chrome/grit/generated_resources.h" | 13 #include "chrome/grit/generated_resources.h" |
| 14 #include "components/login/localized_values_builder.h" | 14 #include "components/login/localized_values_builder.h" |
| 15 #include "components/strings/grit/components_strings.h" | 15 #include "components/strings/grit/components_strings.h" |
| 16 #include "content/public/browser/notification_details.h" | 16 #include "content/public/browser/notification_details.h" |
| 17 #include "content/public/browser/notification_service.h" | 17 #include "content/public/browser/notification_service.h" |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 const char kJsScreenPath[] = "login.KioskEnableScreen"; | 21 const char kJsScreenPath[] = "login.KioskEnableScreen"; |
| 22 | 22 |
| 23 } // namespace | 23 } // namespace |
| 24 | 24 |
| 25 namespace chromeos { | 25 namespace chromeos { |
| 26 | 26 |
| 27 KioskEnableScreenHandler::KioskEnableScreenHandler() | 27 KioskEnableScreenHandler::KioskEnableScreenHandler() : weak_ptr_factory_(this) { |
| 28 : BaseScreenHandler(kJsScreenPath), | 28 set_call_js_prefix(kJsScreenPath); |
| 29 delegate_(NULL), | |
| 30 show_on_init_(false), | |
| 31 is_configurable_(false), | |
| 32 weak_ptr_factory_(this) { | |
| 33 } | 29 } |
| 34 | 30 |
| 35 KioskEnableScreenHandler::~KioskEnableScreenHandler() { | 31 KioskEnableScreenHandler::~KioskEnableScreenHandler() { |
| 36 if (delegate_) | 32 if (delegate_) |
| 37 delegate_->OnActorDestroyed(this); | 33 delegate_->OnActorDestroyed(this); |
| 38 } | 34 } |
| 39 | 35 |
| 40 void KioskEnableScreenHandler::Show() { | 36 void KioskEnableScreenHandler::Show() { |
| 41 if (!page_is_ready()) { | 37 if (!page_is_ready()) { |
| 42 show_on_init_ = true; | 38 show_on_init_ = true; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 CallJS("onCompleted", success); | 133 CallJS("onCompleted", success); |
| 138 if (success) { | 134 if (success) { |
| 139 content::NotificationService::current()->Notify( | 135 content::NotificationService::current()->Notify( |
| 140 chrome::NOTIFICATION_KIOSK_ENABLED, | 136 chrome::NOTIFICATION_KIOSK_ENABLED, |
| 141 content::NotificationService::AllSources(), | 137 content::NotificationService::AllSources(), |
| 142 content::NotificationService::NoDetails()); | 138 content::NotificationService::NoDetails()); |
| 143 } | 139 } |
| 144 } | 140 } |
| 145 | 141 |
| 146 } // namespace chromeos | 142 } // namespace chromeos |
| OLD | NEW |