| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/gtk/options/passwords_page_gtk.h" | 5 #include "chrome/browser/ui/gtk/options/passwords_page_gtk.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/stl_util-inl.h" | 9 #include "base/stl_util-inl.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 l10n_util::GetStringUTF8( | 237 l10n_util::GetStringUTF8( |
| 238 IDS_PASSWORDS_PAGE_VIEW_TEXT_DELETE_ALL_PASSWORDS).c_str()); | 238 IDS_PASSWORDS_PAGE_VIEW_TEXT_DELETE_ALL_PASSWORDS).c_str()); |
| 239 gtk_util::ApplyMessageDialogQuirks(confirm); | 239 gtk_util::ApplyMessageDialogQuirks(confirm); |
| 240 gtk_window_set_title(GTK_WINDOW(confirm), l10n_util::GetStringUTF8( | 240 gtk_window_set_title(GTK_WINDOW(confirm), l10n_util::GetStringUTF8( |
| 241 IDS_PASSWORDS_PAGE_VIEW_CAPTION_DELETE_ALL_PASSWORDS).c_str()); | 241 IDS_PASSWORDS_PAGE_VIEW_CAPTION_DELETE_ALL_PASSWORDS).c_str()); |
| 242 g_signal_connect(confirm, "response", | 242 g_signal_connect(confirm, "response", |
| 243 G_CALLBACK(OnRemoveAllConfirmResponseThunk), this); | 243 G_CALLBACK(OnRemoveAllConfirmResponseThunk), this); |
| 244 gtk_widget_show_all(confirm); | 244 gtk_widget_show_all(confirm); |
| 245 } | 245 } |
| 246 | 246 |
| 247 void PasswordsPageGtk::OnRemoveAllConfirmResponse(GtkWidget* confirm, | 247 void PasswordsPageGtk::OnRemoveAllConfirmResponse(GtkWidget* dialog, |
| 248 gint response) { | 248 int response_id) { |
| 249 bool confirmed = false; | 249 bool confirmed = false; |
| 250 switch (response) { | 250 switch (response_id) { |
| 251 case GTK_RESPONSE_YES: | 251 case GTK_RESPONSE_YES: |
| 252 confirmed = true; | 252 confirmed = true; |
| 253 break; | 253 break; |
| 254 default: | 254 default: |
| 255 break; | 255 break; |
| 256 } | 256 } |
| 257 gtk_widget_destroy(confirm); | 257 gtk_widget_destroy(dialog); |
| 258 if (!confirmed) | 258 if (!confirmed) |
| 259 return; | 259 return; |
| 260 | 260 |
| 261 // Remove from GTK list, DB, and vector. | 261 // Remove from GTK list, DB, and vector. |
| 262 PasswordStore* store = GetPasswordStore(); | 262 PasswordStore* store = GetPasswordStore(); |
| 263 gtk_list_store_clear(password_list_store_); | 263 gtk_list_store_clear(password_list_store_); |
| 264 for (size_t i = 0; i < password_list_.size(); ++i) | 264 for (size_t i = 0; i < password_list_.size(); ++i) |
| 265 store->RemoveLogin(*password_list_[i]); | 265 store->RemoveLogin(*password_list_[i]); |
| 266 STLDeleteElements(&password_list_); | 266 STLDeleteElements(&password_list_); |
| 267 gtk_widget_set_sensitive(remove_all_button_, FALSE); | 267 gtk_widget_set_sensitive(remove_all_button_, FALSE); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 else | 358 else |
| 359 LOG(ERROR) << "No password store! Cannot display passwords."; | 359 LOG(ERROR) << "No password store! Cannot display passwords."; |
| 360 } | 360 } |
| 361 | 361 |
| 362 void PasswordsPageGtk::PasswordListPopulater::OnPasswordStoreRequestDone( | 362 void PasswordsPageGtk::PasswordListPopulater::OnPasswordStoreRequestDone( |
| 363 int handle, const std::vector<webkit_glue::PasswordForm*>& result) { | 363 int handle, const std::vector<webkit_glue::PasswordForm*>& result) { |
| 364 DCHECK_EQ(pending_login_query_, handle); | 364 DCHECK_EQ(pending_login_query_, handle); |
| 365 pending_login_query_ = 0; | 365 pending_login_query_ = 0; |
| 366 page_->SetPasswordList(result); | 366 page_->SetPasswordList(result); |
| 367 } | 367 } |
| OLD | NEW |