| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/gtk/options/passwords_page_gtk.h" | 5 #include "chrome/browser/gtk/options/passwords_page_gtk.h" |
| 6 | 6 |
| 7 #include "app/gfx/gtk_util.h" | 7 #include "app/gfx/gtk_util.h" |
| 8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
| 9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
| 10 #include "chrome/common/gtk_tree.h" | 10 #include "chrome/common/gtk_tree.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 page->password_list_.erase(page->password_list_.begin() + index); | 193 page->password_list_.erase(page->password_list_.begin() + index); |
| 194 | 194 |
| 195 gtk_widget_set_sensitive(page->remove_all_button_, | 195 gtk_widget_set_sensitive(page->remove_all_button_, |
| 196 page->password_list_.size() > 0); | 196 page->password_list_.size() > 0); |
| 197 } | 197 } |
| 198 | 198 |
| 199 // static | 199 // static |
| 200 void PasswordsPageGtk::OnRemoveAllButtonClicked(GtkButton* widget, | 200 void PasswordsPageGtk::OnRemoveAllButtonClicked(GtkButton* widget, |
| 201 PasswordsPageGtk* page) { | 201 PasswordsPageGtk* page) { |
| 202 GtkWindow* window = GTK_WINDOW(gtk_widget_get_toplevel(page->page_)); | 202 GtkWindow* window = GTK_WINDOW(gtk_widget_get_toplevel(page->page_)); |
| 203 GtkWidget* confirm = gtk_message_dialog_new(window, | 203 GtkWidget* confirm = gtk_message_dialog_new( |
| 204 GTK_DIALOG_DESTROY_WITH_PARENT, | 204 window, |
| 205 GTK_MESSAGE_QUESTION, | 205 static_cast<GtkDialogFlags>( |
| 206 GTK_BUTTONS_YES_NO, | 206 GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT), |
| 207 "%s", | 207 GTK_MESSAGE_QUESTION, |
| 208 l10n_util::GetStringUTF8( | 208 GTK_BUTTONS_YES_NO, |
| 209 "%s", |
| 210 l10n_util::GetStringUTF8( |
| 209 IDS_PASSWORDS_PAGE_VIEW_TEXT_DELETE_ALL_PASSWORDS).c_str()); | 211 IDS_PASSWORDS_PAGE_VIEW_TEXT_DELETE_ALL_PASSWORDS).c_str()); |
| 210 gtk_window_set_modal(GTK_WINDOW(confirm), TRUE); | 212 gtk_util::ApplyMessageDialogQuirks(confirm); |
| 211 gtk_window_set_title(GTK_WINDOW(confirm), l10n_util::GetStringUTF8( | 213 gtk_window_set_title(GTK_WINDOW(confirm), l10n_util::GetStringUTF8( |
| 212 IDS_PASSWORDS_PAGE_VIEW_CAPTION_DELETE_ALL_PASSWORDS).c_str()); | 214 IDS_PASSWORDS_PAGE_VIEW_CAPTION_DELETE_ALL_PASSWORDS).c_str()); |
| 213 g_signal_connect(confirm, "response", G_CALLBACK(OnRemoveAllConfirmResponse), | 215 g_signal_connect(confirm, "response", G_CALLBACK(OnRemoveAllConfirmResponse), |
| 214 page); | 216 page); |
| 215 gtk_widget_show_all(confirm); | 217 gtk_widget_show_all(confirm); |
| 216 } | 218 } |
| 217 | 219 |
| 218 // static | 220 // static |
| 219 void PasswordsPageGtk::OnRemoveAllConfirmResponse(GtkDialog* confirm, | 221 void PasswordsPageGtk::OnRemoveAllConfirmResponse(GtkDialog* confirm, |
| 220 gint response, | 222 gint response, |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 PasswordStore* store = page_->GetPasswordStore(); | 318 PasswordStore* store = page_->GetPasswordStore(); |
| 317 pending_login_query_ = store->GetAutofillableLogins(this); | 319 pending_login_query_ = store->GetAutofillableLogins(this); |
| 318 } | 320 } |
| 319 | 321 |
| 320 void PasswordsPageGtk::PasswordListPopulater::OnPasswordStoreRequestDone( | 322 void PasswordsPageGtk::PasswordListPopulater::OnPasswordStoreRequestDone( |
| 321 int handle, const std::vector<webkit_glue::PasswordForm*>& result) { | 323 int handle, const std::vector<webkit_glue::PasswordForm*>& result) { |
| 322 DCHECK_EQ(pending_login_query_, handle); | 324 DCHECK_EQ(pending_login_query_, handle); |
| 323 pending_login_query_ = 0; | 325 pending_login_query_ = 0; |
| 324 page_->SetPasswordList(result); | 326 page_->SetPasswordList(result); |
| 325 } | 327 } |
| OLD | NEW |