Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/options/password_manager_handler.h" | 5 #include "chrome/browser/ui/webui/options/password_manager_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "chrome/browser/chrome_notification_types.h" | 12 #include "chrome/browser/chrome_notification_types.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 14 #if defined(OS_WIN) && defined(USE_ASH) | |
| 15 #include "chrome/browser/ui/ash/ash_util.h" | |
| 16 #endif | |
| 14 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
| 15 #include "chrome/common/url_constants.h" | 18 #include "chrome/common/url_constants.h" |
| 16 #include "components/autofill/core/common/password_form.h" | 19 #include "components/autofill/core/common/password_form.h" |
| 17 #include "content/public/browser/notification_details.h" | 20 #include "content/public/browser/notification_details.h" |
| 18 #include "content/public/browser/notification_source.h" | 21 #include "content/public/browser/notification_source.h" |
| 19 #include "content/public/browser/user_metrics.h" | 22 #include "content/public/browser/user_metrics.h" |
| 20 #include "content/public/browser/web_contents.h" | 23 #include "content/public/browser/web_contents.h" |
| 21 #include "content/public/browser/web_contents_view.h" | 24 #include "content/public/browser/web_contents_view.h" |
| 22 #include "content/public/browser/web_ui.h" | 25 #include "content/public/browser/web_ui.h" |
| 23 #include "grit/chromium_strings.h" | 26 #include "grit/chromium_strings.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 62 { "passwordsNoExceptionsDescription", | 65 { "passwordsNoExceptionsDescription", |
| 63 IDS_PASSWORDS_PAGE_VIEW_NO_EXCEPTIONS_DESCRIPTION }, | 66 IDS_PASSWORDS_PAGE_VIEW_NO_EXCEPTIONS_DESCRIPTION }, |
| 64 }; | 67 }; |
| 65 | 68 |
| 66 RegisterStrings(localized_strings, resources, arraysize(resources)); | 69 RegisterStrings(localized_strings, resources, arraysize(resources)); |
| 67 RegisterTitle(localized_strings, "passwordsPage", | 70 RegisterTitle(localized_strings, "passwordsPage", |
| 68 IDS_PASSWORDS_EXCEPTIONS_WINDOW_TITLE); | 71 IDS_PASSWORDS_EXCEPTIONS_WINDOW_TITLE); |
| 69 | 72 |
| 70 localized_strings->SetString("passwordManagerLearnMoreURL", | 73 localized_strings->SetString("passwordManagerLearnMoreURL", |
| 71 chrome::kPasswordManagerLearnMoreURL); | 74 chrome::kPasswordManagerLearnMoreURL); |
| 75 | |
| 76 #if defined(OS_WIN) && defined(USE_ASH) | |
|
Patrick Dubroy
2013/12/13 14:19:10
Can you add a comment here to explain what this is
Will Harris
2013/12/16 17:18:28
Done.
| |
| 77 if (chrome::IsNativeWindowInAsh(GetNativeWindow())) | |
| 78 localized_strings->SetBoolean("disableShowPasswords", true); | |
| 79 #endif | |
| 72 } | 80 } |
| 73 | 81 |
| 74 void PasswordManagerHandler::RegisterMessages() { | 82 void PasswordManagerHandler::RegisterMessages() { |
| 75 web_ui()->RegisterMessageCallback( | 83 web_ui()->RegisterMessageCallback( |
| 76 "updatePasswordLists", | 84 "updatePasswordLists", |
| 77 base::Bind(&PasswordManagerHandler::HandleUpdatePasswordLists, | 85 base::Bind(&PasswordManagerHandler::HandleUpdatePasswordLists, |
| 78 base::Unretained(this))); | 86 base::Unretained(this))); |
| 79 web_ui()->RegisterMessageCallback( | 87 web_ui()->RegisterMessageCallback( |
| 80 "removeSavedPassword", | 88 "removeSavedPassword", |
| 81 base::Bind(&PasswordManagerHandler::HandleRemoveSavedPassword, | 89 base::Bind(&PasswordManagerHandler::HandleRemoveSavedPassword, |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 164 for (size_t i = 0; i < password_exception_list.size(); ++i) { | 172 for (size_t i = 0; i < password_exception_list.size(); ++i) { |
| 165 entries.Append(new StringValue( | 173 entries.Append(new StringValue( |
| 166 net::FormatUrl(password_exception_list[i]->origin, languages_))); | 174 net::FormatUrl(password_exception_list[i]->origin, languages_))); |
| 167 } | 175 } |
| 168 | 176 |
| 169 web_ui()->CallJavascriptFunction("PasswordManager.setPasswordExceptionsList", | 177 web_ui()->CallJavascriptFunction("PasswordManager.setPasswordExceptionsList", |
| 170 entries); | 178 entries); |
| 171 } | 179 } |
| 172 | 180 |
| 173 } // namespace options | 181 } // namespace options |
| OLD | NEW |