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

Side by Side Diff: chrome/browser/ui/webui/signin/md_user_manager_ui.cc

Issue 1826903002: updated UI, default profile name, check for existing supervised user before create (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 years, 8 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/signin/md_user_manager_ui.h" 5 #include "chrome/browser/ui/webui/signin/md_user_manager_ui.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
11 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/browser/ui/webui/signin/signin_create_profile_handler.h" 12 #include "chrome/browser/ui/webui/signin/signin_create_profile_handler.h"
13 #include "chrome/browser/ui/webui/signin/user_manager_screen_handler.h" 13 #include "chrome/browser/ui/webui/signin/user_manager_screen_handler.h"
14 #include "chrome/browser/ui/webui/theme_source.h" 14 #include "chrome/browser/ui/webui/theme_source.h"
15 #include "chrome/common/url_constants.h" 15 #include "chrome/common/url_constants.h"
16 #include "content/public/browser/web_ui.h" 16 #include "content/public/browser/web_ui.h"
17 #include "content/public/browser/web_ui_data_source.h" 17 #include "content/public/browser/web_ui_data_source.h"
18 #include "grit/browser_resources.h" 18 #include "grit/browser_resources.h"
19 #include "grit/settings_resources.h" 19 #include "grit/settings_resources.h"
20 #include "ui/base/resource/resource_bundle.h" 20 #include "ui/base/resource/resource_bundle.h"
21 #include "ui/base/webui/web_ui_util.h" 21 #include "ui/base/webui/web_ui_util.h"
22 22
23 #if defined(ENABLE_SUPERVISED_USERS)
24 #include "chrome/browser/ui/webui/signin/signin_supervised_user_import_handler.h "
25 #endif
26
23 MDUserManagerUI::MDUserManagerUI(content::WebUI* web_ui) 27 MDUserManagerUI::MDUserManagerUI(content::WebUI* web_ui)
24 : WebUIController(web_ui), 28 : WebUIController(web_ui),
25 signin_create_profile_handler_(new SigninCreateProfileHandler()), 29 signin_create_profile_handler_(new SigninCreateProfileHandler()),
26 user_manager_screen_handler_(new UserManagerScreenHandler()) { 30 user_manager_screen_handler_(new UserManagerScreenHandler()) {
27 // The web_ui object takes ownership of these handlers, and will 31 // The web_ui object takes ownership of these handlers, and will
28 // destroy them when it (the WebUI) is destroyed. 32 // destroy them when it (the WebUI) is destroyed.
29 web_ui->AddMessageHandler(signin_create_profile_handler_); 33 web_ui->AddMessageHandler(signin_create_profile_handler_);
30 web_ui->AddMessageHandler(user_manager_screen_handler_); 34 web_ui->AddMessageHandler(user_manager_screen_handler_);
35 #if defined(ENABLE_SUPERVISED_USERS)
36 signin_supervised_user_import_handler_ =
37 new SigninSupervisedUserImportHandler();
38 web_ui->AddMessageHandler(signin_supervised_user_import_handler_);
39 #endif
31 40
32 base::DictionaryValue localized_strings; 41 base::DictionaryValue localized_strings;
33 GetLocalizedStrings(&localized_strings); 42 GetLocalizedStrings(&localized_strings);
34 43
35 Profile* profile = Profile::FromWebUI(web_ui); 44 Profile* profile = Profile::FromWebUI(web_ui);
36 // Set up the chrome://user-chooser/ source. 45 // Set up the chrome://user-chooser/ source.
37 content::WebUIDataSource::Add(profile, CreateUIDataSource(localized_strings)); 46 content::WebUIDataSource::Add(profile, CreateUIDataSource(localized_strings));
38 47
39 #if defined(ENABLE_THEMES) 48 #if defined(ENABLE_THEMES)
40 // Set up the chrome://theme/ source 49 // Set up the chrome://theme/ source
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 signin_create_profile_handler_->GetLocalizedValues(localized_strings); 107 signin_create_profile_handler_->GetLocalizedValues(localized_strings);
99 const std::string& app_locale = g_browser_process->GetApplicationLocale(); 108 const std::string& app_locale = g_browser_process->GetApplicationLocale();
100 webui::SetLoadTimeDataDefaults(app_locale, localized_strings); 109 webui::SetLoadTimeDataDefaults(app_locale, localized_strings);
101 110
102 #if defined(GOOGLE_CHROME_BUILD) 111 #if defined(GOOGLE_CHROME_BUILD)
103 localized_strings->SetString("buildType", "chrome"); 112 localized_strings->SetString("buildType", "chrome");
104 #else 113 #else
105 localized_strings->SetString("buildType", "chromium"); 114 localized_strings->SetString("buildType", "chromium");
106 #endif 115 #endif
107 } 116 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/signin/md_user_manager_ui.h ('k') | chrome/browser/ui/webui/signin/signin_create_profile_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698