| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/eula_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/eula_screen_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" |
| 9 #include "base/values.h" | 11 #include "base/values.h" |
| 10 #include "chrome/browser/chromeos/login/help_app_launcher.h" | 12 #include "chrome/browser/chromeos/login/help_app_launcher.h" |
| 11 #include "chrome/browser/chromeos/login/webui_login_display.h" | 13 #include "chrome/browser/chromeos/login/webui_login_display.h" |
| 12 #include "chrome/common/url_constants.h" | 14 #include "chrome/common/url_constants.h" |
| 13 #include "grit/browser_resources.h" | 15 #include "grit/browser_resources.h" |
| 14 #include "grit/chromium_strings.h" | 16 #include "grit/chromium_strings.h" |
| 15 #include "grit/generated_resources.h" | 17 #include "grit/generated_resources.h" |
| 16 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
| 17 #include "views/widget/widget.h" | 19 #include "views/widget/widget.h" |
| 18 | 20 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 } | 96 } |
| 95 | 97 |
| 96 if (show_on_init_) { | 98 if (show_on_init_) { |
| 97 Show(); | 99 Show(); |
| 98 show_on_init_ = false; | 100 show_on_init_ = false; |
| 99 } | 101 } |
| 100 } | 102 } |
| 101 | 103 |
| 102 void EulaScreenHandler::RegisterMessages() { | 104 void EulaScreenHandler::RegisterMessages() { |
| 103 web_ui_->RegisterMessageCallback("eulaOnExit", | 105 web_ui_->RegisterMessageCallback("eulaOnExit", |
| 104 NewCallback(this, &EulaScreenHandler::HandleOnExit)); | 106 base::Bind(&EulaScreenHandler::HandleOnExit,base::Unretained(this))); |
| 105 web_ui_->RegisterMessageCallback("eulaOnLearnMore", | 107 web_ui_->RegisterMessageCallback("eulaOnLearnMore", |
| 106 NewCallback(this, &EulaScreenHandler::HandleOnLearnMore)); | 108 base::Bind(&EulaScreenHandler::HandleOnLearnMore,base::Unretained(this))); |
| 107 web_ui_->RegisterMessageCallback("eulaOnTpmPopupOpened", | 109 web_ui_->RegisterMessageCallback("eulaOnTpmPopupOpened", |
| 108 NewCallback(this, &EulaScreenHandler::HandleOnTpmPopupOpened)); | 110 base::Bind(&EulaScreenHandler::HandleOnTpmPopupOpened, |
| 111 base::Unretained(this))); |
| 109 } | 112 } |
| 110 | 113 |
| 111 void EulaScreenHandler::OnPasswordFetched(const std::string& tpm_password) { | 114 void EulaScreenHandler::OnPasswordFetched(const std::string& tpm_password) { |
| 112 StringValue tpm_password_value(tpm_password); | 115 StringValue tpm_password_value(tpm_password); |
| 113 web_ui_->CallJavascriptFunction("cr.ui.Oobe.setTpmPassword", | 116 web_ui_->CallJavascriptFunction("cr.ui.Oobe.setTpmPassword", |
| 114 tpm_password_value); | 117 tpm_password_value); |
| 115 } | 118 } |
| 116 | 119 |
| 117 void EulaScreenHandler::HandleOnExit(const base::ListValue* args) { | 120 void EulaScreenHandler::HandleOnExit(const base::ListValue* args) { |
| 118 DCHECK(args->GetSize() == 2); | 121 DCHECK(args->GetSize() == 2); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 139 help_app_->ShowHelpTopic(HelpAppLauncher::HELP_STATS_USAGE); | 142 help_app_->ShowHelpTopic(HelpAppLauncher::HELP_STATS_USAGE); |
| 140 } | 143 } |
| 141 | 144 |
| 142 void EulaScreenHandler::HandleOnTpmPopupOpened(const base::ListValue* args) { | 145 void EulaScreenHandler::HandleOnTpmPopupOpened(const base::ListValue* args) { |
| 143 if (!delegate_) | 146 if (!delegate_) |
| 144 return; | 147 return; |
| 145 delegate_->InitiatePasswordFetch(); | 148 delegate_->InitiatePasswordFetch(); |
| 146 } | 149 } |
| 147 | 150 |
| 148 } // namespace chromeos | 151 } // namespace chromeos |
| OLD | NEW |