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

Side by Side Diff: chrome/browser/ui/webui/settings/passwords_handler.cc

Issue 1457713007: Update the "Passwords and Forms" section so that they can be toggled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/webui/settings/passwords_handler.h"
6
7 #include "base/bind.h"
8 #include "base/prefs/pref_service.h"
9 #include "chrome/browser/profiles/profile.h"
10 #include "components/password_manager/core/common/password_manager_pref_names.h"
11 #include "content/public/browser/web_ui.h"
12
13 namespace settings {
14
15 PasswordsHandler::PasswordsHandler(content::WebUI* webui)
16 : profile_(Profile::FromWebUI(webui)) {}
17
18 PasswordsHandler::~PasswordsHandler() {}
19
20 void PasswordsHandler::RegisterMessages() {
21 web_ui()->RegisterMessageCallback(
22 "setPasswordSaving", base::Bind(&PasswordsHandler::HandleSetPaswordSaving,
23 base::Unretained(this)));
24 }
25
26 void PasswordsHandler::HandleSetPaswordSaving(const base::ListValue* args) {
27 CHECK_EQ(1U, args->GetSize());
28 bool enabled = false;
29 CHECK(args->GetBoolean(0, &enabled));
30
31 PrefService* prefs = profile_->GetPrefs();
32 prefs->SetBoolean(password_manager::prefs::kPasswordManagerSavingEnabled,
dschuyler 2015/11/20 20:02:50 Can this be exposed with settingsPrivate rather th
33 enabled);
34 }
35
36 } // namespace settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698