| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/password_manager/native_backend_gnome_x.h" | 5 #include "chrome/browser/password_manager/native_backend_gnome_x.h" |
| 6 | 6 |
| 7 #include <dbus/dbus-glib.h> | 7 #include <dbus/dbus-glib.h> |
| 8 #include <dlfcn.h> | 8 #include <dlfcn.h> |
| 9 #include <gnome-keyring.h> | 9 #include <gnome-keyring.h> |
| 10 | 10 |
| 11 #include <map> | 11 #include <map> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/string_number_conversions.h" |
| 16 #include "base/string_util.h" | 17 #include "base/string_util.h" |
| 17 #include "base/time.h" | 18 #include "base/time.h" |
| 18 #include "base/utf_string_conversions.h" | 19 #include "base/utf_string_conversions.h" |
| 19 #include "base/waitable_event.h" | 20 #include "base/waitable_event.h" |
| 20 #include "chrome/browser/chrome_thread.h" | 21 #include "chrome/browser/chrome_thread.h" |
| 21 | 22 |
| 22 using webkit_glue::PasswordForm; | 23 using webkit_glue::PasswordForm; |
| 23 | 24 |
| 24 namespace { | 25 namespace { |
| 25 | 26 |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 NULL, // destroy_data | 315 NULL, // destroy_data |
| 315 "origin_url", form.origin.spec().c_str(), | 316 "origin_url", form.origin.spec().c_str(), |
| 316 "action_url", form.action.spec().c_str(), | 317 "action_url", form.action.spec().c_str(), |
| 317 "username_element", UTF16ToUTF8(form.username_element).c_str(), | 318 "username_element", UTF16ToUTF8(form.username_element).c_str(), |
| 318 "username_value", UTF16ToUTF8(form.username_value).c_str(), | 319 "username_value", UTF16ToUTF8(form.username_value).c_str(), |
| 319 "password_element", UTF16ToUTF8(form.password_element).c_str(), | 320 "password_element", UTF16ToUTF8(form.password_element).c_str(), |
| 320 "submit_element", UTF16ToUTF8(form.submit_element).c_str(), | 321 "submit_element", UTF16ToUTF8(form.submit_element).c_str(), |
| 321 "signon_realm", form.signon_realm.c_str(), | 322 "signon_realm", form.signon_realm.c_str(), |
| 322 "ssl_valid", form.ssl_valid, | 323 "ssl_valid", form.ssl_valid, |
| 323 "preferred", form.preferred, | 324 "preferred", form.preferred, |
| 324 "date_created", Int64ToString(form.date_created.ToTimeT()).c_str(), | 325 "date_created", base::Int64ToString(form.date_created.ToTimeT()).c_str(), |
| 325 "blacklisted_by_user", form.blacklisted_by_user, | 326 "blacklisted_by_user", form.blacklisted_by_user, |
| 326 "scheme", form.scheme, | 327 "scheme", form.scheme, |
| 327 "application", GNOME_KEYRING_APPLICATION_CHROME, | 328 "application", GNOME_KEYRING_APPLICATION_CHROME, |
| 328 NULL); | 329 NULL); |
| 329 } | 330 } |
| 330 | 331 |
| 331 void GKRMethod::UpdateLoginSearch(const PasswordForm& form) { | 332 void GKRMethod::UpdateLoginSearch(const PasswordForm& form) { |
| 332 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); | 333 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); |
| 333 // Search GNOME Keyring for matching passwords to update. | 334 // Search GNOME Keyring for matching passwords to update. |
| 334 gnome_keyring_find_itemsv( | 335 gnome_keyring_find_itemsv( |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 814 } | 815 } |
| 815 } else { | 816 } else { |
| 816 // Otherwise, free them. | 817 // Otherwise, free them. |
| 817 for (size_t i = 0; i < item_ids.size(); ++i) | 818 for (size_t i = 0; i < item_ids.size(); ++i) |
| 818 delete all_forms[i]; | 819 delete all_forms[i]; |
| 819 } | 820 } |
| 820 | 821 |
| 821 return success; | 822 return success; |
| 822 #endif | 823 #endif |
| 823 } | 824 } |
| OLD | NEW |