| 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/gtk/options/passwords_exceptions_page_gtk.h" | 5 #include "chrome/browser/gtk/options/passwords_exceptions_page_gtk.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 109 |
| 110 void PasswordsExceptionsPageGtk::SetExceptionList( | 110 void PasswordsExceptionsPageGtk::SetExceptionList( |
| 111 const std::vector<webkit_glue::PasswordForm*>& result) { | 111 const std::vector<webkit_glue::PasswordForm*>& result) { |
| 112 std::wstring languages = | 112 std::wstring languages = |
| 113 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages); | 113 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages); |
| 114 gtk_list_store_clear(exception_list_store_); | 114 gtk_list_store_clear(exception_list_store_); |
| 115 exception_list_.resize(result.size()); | 115 exception_list_.resize(result.size()); |
| 116 for (size_t i = 0; i < result.size(); ++i) { | 116 for (size_t i = 0; i < result.size(); ++i) { |
| 117 exception_list_[i] = *result[i]; | 117 exception_list_[i] = *result[i]; |
| 118 std::wstring formatted = net::FormatUrl(result[i]->origin, languages, | 118 std::wstring formatted = net::FormatUrl(result[i]->origin, languages, |
| 119 false, UnescapeRule::NONE, NULL, NULL, NULL); | 119 net::kFormatUrlOmitAll, UnescapeRule::NONE, NULL, NULL, NULL); |
| 120 std::string site = WideToUTF8(formatted); | 120 std::string site = WideToUTF8(formatted); |
| 121 GtkTreeIter iter; | 121 GtkTreeIter iter; |
| 122 gtk_list_store_insert_with_values(exception_list_store_, &iter, (gint) i, | 122 gtk_list_store_insert_with_values(exception_list_store_, &iter, (gint) i, |
| 123 COL_SITE, site.c_str(), -1); | 123 COL_SITE, site.c_str(), -1); |
| 124 } | 124 } |
| 125 gtk_widget_set_sensitive(remove_all_button_, result.size() > 0); | 125 gtk_widget_set_sensitive(remove_all_button_, result.size() > 0); |
| 126 } | 126 } |
| 127 | 127 |
| 128 void PasswordsExceptionsPageGtk::OnRemoveButtonClicked(GtkWidget* widget) { | 128 void PasswordsExceptionsPageGtk::OnRemoveButtonClicked(GtkWidget* widget) { |
| 129 GtkTreeIter iter; | 129 GtkTreeIter iter; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 pending_login_query_ = store->GetBlacklistLogins(this); | 192 pending_login_query_ = store->GetBlacklistLogins(this); |
| 193 } | 193 } |
| 194 | 194 |
| 195 void | 195 void |
| 196 PasswordsExceptionsPageGtk::ExceptionListPopulater::OnPasswordStoreRequestDone( | 196 PasswordsExceptionsPageGtk::ExceptionListPopulater::OnPasswordStoreRequestDone( |
| 197 int handle, const std::vector<webkit_glue::PasswordForm*>& result) { | 197 int handle, const std::vector<webkit_glue::PasswordForm*>& result) { |
| 198 DCHECK_EQ(pending_login_query_, handle); | 198 DCHECK_EQ(pending_login_query_, handle); |
| 199 pending_login_query_ = 0; | 199 pending_login_query_ = 0; |
| 200 page_->SetExceptionList(result); | 200 page_->SetExceptionList(result); |
| 201 } | 201 } |
| OLD | NEW |