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

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

Issue 763563002: Implemented event-dispatching for button clicks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 6 years 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
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/eula_screen_handler.h ('k') | ui/login/screen.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/chromeos/login/help_app_launcher.h" 10 #include "chrome/browser/chromeos/login/help_app_launcher.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 builder->AddF("eulaRlzEnable", 140 builder->AddF("eulaRlzEnable",
141 IDS_EULA_RLZ_ENABLE, 141 IDS_EULA_RLZ_ENABLE,
142 IDS_SHORT_PRODUCT_OS_NAME); 142 IDS_SHORT_PRODUCT_OS_NAME);
143 #endif 143 #endif
144 144
145 builder->Add("chromeCreditsLink", IDS_ABOUT_VERSION_LICENSE_EULA); 145 builder->Add("chromeCreditsLink", IDS_ABOUT_VERSION_LICENSE_EULA);
146 builder->Add("chromeosCreditsLink", IDS_ABOUT_CROS_VERSION_LICENSE_EULA); 146 builder->Add("chromeosCreditsLink", IDS_ABOUT_CROS_VERSION_LICENSE_EULA);
147 } 147 }
148 148
149 void EulaScreenHandler::DeclareJSCallbacks() { 149 void EulaScreenHandler::DeclareJSCallbacks() {
150 AddCallback("eulaAcceptButtonClicked",
151 &EulaScreenHandler::HandleAcceptButtonClicked);
152 AddCallback("eulaBackButtonClicked",
153 &EulaScreenHandler::HandleBackButtonClicked);
154 AddCallback("eulaOnLearnMore", &EulaScreenHandler::HandleOnLearnMore); 150 AddCallback("eulaOnLearnMore", &EulaScreenHandler::HandleOnLearnMore);
155 AddCallback("eulaOnChromeOSCredits", 151 AddCallback("eulaOnChromeOSCredits",
156 &EulaScreenHandler::HandleOnChromeOSCredits); 152 &EulaScreenHandler::HandleOnChromeOSCredits);
157 AddCallback("eulaOnChromeCredits", &EulaScreenHandler::HandleOnChromeCredits); 153 AddCallback("eulaOnChromeCredits", &EulaScreenHandler::HandleOnChromeCredits);
158 AddCallback("eulaOnLearnMore", &EulaScreenHandler::HandleOnLearnMore); 154 AddCallback("eulaOnLearnMore", &EulaScreenHandler::HandleOnLearnMore);
159 AddCallback("eulaOnInstallationSettingsPopupOpened", 155 AddCallback("eulaOnInstallationSettingsPopupOpened",
160 &EulaScreenHandler::HandleOnInstallationSettingsPopupOpened); 156 &EulaScreenHandler::HandleOnInstallationSettingsPopupOpened);
161 } 157 }
162 158
163 void EulaScreenHandler::GetAdditionalParameters(base::DictionaryValue* dict) { 159 void EulaScreenHandler::GetAdditionalParameters(base::DictionaryValue* dict) {
(...skipping 18 matching lines...) Expand all
182 if (show_on_init_) { 178 if (show_on_init_) {
183 Show(); 179 Show();
184 show_on_init_ = false; 180 show_on_init_ = false;
185 } 181 }
186 } 182 }
187 183
188 void EulaScreenHandler::OnPasswordFetched(const std::string& tpm_password) { 184 void EulaScreenHandler::OnPasswordFetched(const std::string& tpm_password) {
189 core_oobe_actor_->SetTpmPassword(tpm_password); 185 core_oobe_actor_->SetTpmPassword(tpm_password);
190 } 186 }
191 187
192 void EulaScreenHandler::HandleAcceptButtonClicked() {
193 if (model_)
194 model_->OnAcceptButtonClicked();
195 }
196
197 void EulaScreenHandler::HandleBackButtonClicked() {
198 if (model_)
199 model_->OnBackButtonClicked();
200 }
201
202 void EulaScreenHandler::HandleOnLearnMore() { 188 void EulaScreenHandler::HandleOnLearnMore() {
203 if (!help_app_.get()) 189 if (!help_app_.get())
204 help_app_ = new HelpAppLauncher(GetNativeWindow()); 190 help_app_ = new HelpAppLauncher(GetNativeWindow());
205 help_app_->ShowHelpTopic(HelpAppLauncher::HELP_STATS_USAGE); 191 help_app_->ShowHelpTopic(HelpAppLauncher::HELP_STATS_USAGE);
206 } 192 }
207 193
208 void EulaScreenHandler::HandleOnChromeOSCredits() { 194 void EulaScreenHandler::HandleOnChromeOSCredits() {
209 ShowCreditsDialog( 195 ShowCreditsDialog(
210 Profile::FromBrowserContext( 196 Profile::FromBrowserContext(
211 web_ui()->GetWebContents()->GetBrowserContext()), 197 web_ui()->GetWebContents()->GetBrowserContext()),
(...skipping 10 matching lines...) Expand all
222 IDS_ABOUT_VERSION_LICENSE_EULA, 208 IDS_ABOUT_VERSION_LICENSE_EULA,
223 GURL(chrome::kChromeUICreditsURL)); 209 GURL(chrome::kChromeUICreditsURL));
224 } 210 }
225 211
226 void EulaScreenHandler::HandleOnInstallationSettingsPopupOpened() { 212 void EulaScreenHandler::HandleOnInstallationSettingsPopupOpened() {
227 if (model_) 213 if (model_)
228 model_->InitiatePasswordFetch(); 214 model_->InitiatePasswordFetch();
229 } 215 }
230 216
231 } // namespace chromeos 217 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/eula_screen_handler.h ('k') | ui/login/screen.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698