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

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

Issue 2700303002: cros: Unify oobe View/Actor naming to just View. (Closed)
Patch Set: Created 3 years, 10 months 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/terms_of_service_screen_handler .h" 5 #include "chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler .h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/bind_helpers.h" 11 #include "base/bind_helpers.h"
12 #include "base/strings/string_split.h" 12 #include "base/strings/string_split.h"
13 #include "base/values.h" 13 #include "base/values.h"
14 #include "chrome/browser/browser_process.h" 14 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/chromeos/base/locale_util.h" 15 #include "chrome/browser/chromeos/base/locale_util.h"
16 #include "chrome/browser/chromeos/login/screens/core_oobe_actor.h" 16 #include "chrome/browser/chromeos/login/screens/core_oobe_view.h"
17 #include "chrome/browser/chromeos/profiles/profile_helper.h" 17 #include "chrome/browser/chromeos/profiles/profile_helper.h"
18 #include "chrome/browser/profiles/profile.h" 18 #include "chrome/browser/profiles/profile.h"
19 #include "chrome/browser/profiles/profile_manager.h" 19 #include "chrome/browser/profiles/profile_manager.h"
20 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" 20 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
21 #include "chrome/common/pref_names.h" 21 #include "chrome/common/pref_names.h"
22 #include "chrome/grit/chromium_strings.h" 22 #include "chrome/grit/chromium_strings.h"
23 #include "chrome/grit/generated_resources.h" 23 #include "chrome/grit/generated_resources.h"
24 #include "components/login/localized_values_builder.h" 24 #include "components/login/localized_values_builder.h"
25 #include "components/prefs/pref_service.h" 25 #include "components/prefs/pref_service.h"
26 #include "components/user_manager/user.h" 26 #include "components/user_manager/user.h"
27 #include "components/user_manager/user_manager.h" 27 #include "components/user_manager/user_manager.h"
28 #include "content/public/browser/web_ui.h" 28 #include "content/public/browser/web_ui.h"
29 #include "ui/base/ime/chromeos/input_method_manager.h" 29 #include "ui/base/ime/chromeos/input_method_manager.h"
30 30
31 namespace { 31 namespace {
32 32
33 const char kJsScreenPath[] = "login.TermsOfServiceScreen"; 33 const char kJsScreenPath[] = "login.TermsOfServiceScreen";
34 34
35 } // namespace 35 } // namespace
36 36
37 namespace chromeos { 37 namespace chromeos {
38 38
39 TermsOfServiceScreenHandler::TermsOfServiceScreenHandler( 39 TermsOfServiceScreenHandler::TermsOfServiceScreenHandler(
40 CoreOobeActor* core_oobe_actor) 40 CoreOobeView* core_oobe_actor)
Alexander Alekseev 2017/02/22 00:21:05 nit: view .
jdufault 2017/02/22 01:02:25 Done.
41 : core_oobe_actor_(core_oobe_actor) { 41 : core_oobe_actor_(core_oobe_actor) {
42 set_call_js_prefix(kJsScreenPath); 42 set_call_js_prefix(kJsScreenPath);
43 } 43 }
44 44
45 TermsOfServiceScreenHandler::~TermsOfServiceScreenHandler() { 45 TermsOfServiceScreenHandler::~TermsOfServiceScreenHandler() {
46 if (screen_) 46 if (screen_)
47 screen_->OnActorDestroyed(this); 47 screen_->OnViewDestroyed(this);
48 } 48 }
49 49
50 void TermsOfServiceScreenHandler::RegisterMessages() { 50 void TermsOfServiceScreenHandler::RegisterMessages() {
51 AddCallback("termsOfServiceBack", 51 AddCallback("termsOfServiceBack",
52 &TermsOfServiceScreenHandler::HandleBack); 52 &TermsOfServiceScreenHandler::HandleBack);
53 AddCallback("termsOfServiceAccept", 53 AddCallback("termsOfServiceAccept",
54 &TermsOfServiceScreenHandler::HandleAccept); 54 &TermsOfServiceScreenHandler::HandleAccept);
55 } 55 }
56 56
57 void TermsOfServiceScreenHandler::DeclareLocalizedValues( 57 void TermsOfServiceScreenHandler::DeclareLocalizedValues(
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 // and continue" button should not be accessible. If the user managed to 204 // and continue" button should not be accessible. If the user managed to
205 // activate it somehow anway, do not treat this as acceptance of the Terms 205 // activate it somehow anway, do not treat this as acceptance of the Terms
206 // and Conditions and end the session instead, as if the user had declined. 206 // and Conditions and end the session instead, as if the user had declined.
207 if (terms_of_service_.empty()) 207 if (terms_of_service_.empty())
208 screen_->OnDecline(); 208 screen_->OnDecline();
209 else 209 else
210 screen_->OnAccept(); 210 screen_->OnAccept();
211 } 211 }
212 212
213 } // namespace chromeos 213 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698