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

Side by Side Diff: chrome/browser/ui/webui/supervised_user_internals_message_handler.cc

Issue 1831813002: chrome://supervised-user-internals: Add Chrome version and "child detection enabled" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/supervised_user_internals_message_handler.h" 5 #include "chrome/browser/ui/webui/supervised_user_internals_message_handler.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/strings/string_util.h" 12 #include "base/strings/string_util.h"
13 #include "base/strings/stringprintf.h" 13 #include "base/strings/stringprintf.h"
14 #include "base/strings/utf_string_conversions.h" 14 #include "base/strings/utf_string_conversions.h"
15 #include "base/values.h" 15 #include "base/values.h"
16 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
17 #include "chrome/browser/signin/account_tracker_service_factory.h" 17 #include "chrome/browser/signin/account_tracker_service_factory.h"
18 #include "chrome/browser/supervised_user/child_accounts/child_account_service.h"
18 #include "chrome/browser/supervised_user/supervised_user_service.h" 19 #include "chrome/browser/supervised_user/supervised_user_service.h"
19 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" 20 #include "chrome/browser/supervised_user/supervised_user_service_factory.h"
20 #include "chrome/browser/supervised_user/supervised_user_settings_service.h" 21 #include "chrome/browser/supervised_user/supervised_user_settings_service.h"
21 #include "chrome/browser/supervised_user/supervised_user_settings_service_factor y.h" 22 #include "chrome/browser/supervised_user/supervised_user_settings_service_factor y.h"
23 #include "chrome/common/channel_info.h"
22 #include "components/signin/core/browser/account_tracker_service.h" 24 #include "components/signin/core/browser/account_tracker_service.h"
23 #include "components/supervised_user_error_page/supervised_user_error_page.h" 25 #include "components/supervised_user_error_page/supervised_user_error_page.h"
24 #include "components/url_formatter/url_fixer.h" 26 #include "components/url_formatter/url_fixer.h"
25 #include "content/public/browser/browser_thread.h" 27 #include "content/public/browser/browser_thread.h"
26 #include "content/public/browser/web_ui.h" 28 #include "content/public/browser/web_ui.h"
27 29
28 using content::BrowserThread; 30 using content::BrowserThread;
29 31
30 namespace { 32 namespace {
31 33
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 std::map<std::string, base::string16> whitelists = 232 std::map<std::string, base::string16> whitelists =
231 filter->GetMatchingWhitelistTitles(url); 233 filter->GetMatchingWhitelistTitles(url);
232 filter->GetFilteringBehaviorForURLWithAsyncChecks( 234 filter->GetFilteringBehaviorForURLWithAsyncChecks(
233 url, base::Bind(&SupervisedUserInternalsMessageHandler::OnTryURLResult, 235 url, base::Bind(&SupervisedUserInternalsMessageHandler::OnTryURLResult,
234 weak_factory_.GetWeakPtr(), whitelists)); 236 weak_factory_.GetWeakPtr(), whitelists));
235 } 237 }
236 238
237 void SupervisedUserInternalsMessageHandler::SendBasicInfo() { 239 void SupervisedUserInternalsMessageHandler::SendBasicInfo() {
238 scoped_ptr<base::ListValue> section_list(new base::ListValue); 240 scoped_ptr<base::ListValue> section_list(new base::ListValue);
239 241
242 base::ListValue* section_general = AddSection(section_list.get(), "General");
243 AddSectionEntry(section_general, "Chrome version",
244 chrome::GetVersionString());
245 AddSectionEntry(section_general, "Child detection enabled",
246 ChildAccountService::IsChildAccountDetectionEnabled());
247
240 Profile* profile = Profile::FromWebUI(web_ui()); 248 Profile* profile = Profile::FromWebUI(web_ui());
241 249
242 base::ListValue* section_profile = AddSection(section_list.get(), "Profile"); 250 base::ListValue* section_profile = AddSection(section_list.get(), "Profile");
243 AddSectionEntry(section_profile, "Account", profile->GetProfileUserName()); 251 AddSectionEntry(section_profile, "Account", profile->GetProfileUserName());
244 AddSectionEntry(section_profile, "Legacy Supervised", 252 AddSectionEntry(section_profile, "Legacy Supervised",
245 profile->IsLegacySupervised()); 253 profile->IsLegacySupervised());
246 AddSectionEntry(section_profile, "Child", profile->IsChild()); 254 AddSectionEntry(section_profile, "Child", profile->IsChild());
247 255
248 SupervisedUserURLFilter* filter = 256 SupervisedUserURLFilter* filter =
249 GetSupervisedUserService()->GetURLFilterForUIThread(); 257 GetSupervisedUserService()->GetURLFilterForUIThread();
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 supervised_user_error_page::FilteringBehaviorReason reason, 328 supervised_user_error_page::FilteringBehaviorReason reason,
321 bool uncertain) { 329 bool uncertain) {
322 DCHECK_CURRENTLY_ON(BrowserThread::UI); 330 DCHECK_CURRENTLY_ON(BrowserThread::UI);
323 base::DictionaryValue result; 331 base::DictionaryValue result;
324 result.SetString("url", url.possibly_invalid_spec()); 332 result.SetString("url", url.possibly_invalid_spec());
325 result.SetString("result", FilteringBehaviorToString(behavior, uncertain)); 333 result.SetString("result", FilteringBehaviorToString(behavior, uncertain));
326 result.SetString("reason", FilteringBehaviorReasonToString(reason)); 334 result.SetString("reason", FilteringBehaviorReasonToString(reason));
327 web_ui()->CallJavascriptFunction( 335 web_ui()->CallJavascriptFunction(
328 "chrome.supervised_user_internals.receiveFilteringResult", result); 336 "chrome.supervised_user_internals.receiveFilteringResult", result);
329 } 337 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698