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 <gtk/gtk.h> | 5 #include <gtk/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 "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "chrome/browser/gtk/options/url_picker_dialog_gtk.h" | 10 #include "chrome/browser/gtk/options/url_picker_dialog_gtk.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 std::string UrlPickerDialogGtk::GetURLForPath(GtkTreePath* path) const { | 189 std::string UrlPickerDialogGtk::GetURLForPath(GtkTreePath* path) const { |
190 gint row = gtk_tree::GetTreeSortChildRowNumForPath(history_list_sort_, path); | 190 gint row = gtk_tree::GetTreeSortChildRowNumForPath(history_list_sort_, path); |
191 if (row < 0) { | 191 if (row < 0) { |
192 NOTREACHED(); | 192 NOTREACHED(); |
193 return std::string(); | 193 return std::string(); |
194 } | 194 } |
195 std::wstring languages = | 195 std::wstring languages = |
196 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages); | 196 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages); |
197 // Because the url_field_ is user-editable, we set the URL with | 197 // Because the url_field_ is user-editable, we set the URL with |
198 // username:password and escaped path and query. | 198 // username:password and escaped path and query. |
199 std::wstring formatted = net::FormatUrl( | 199 std::wstring formatted = net::FormatUrl(url_table_model_->GetURL(row), |
200 url_table_model_->GetURL(row), languages, | 200 languages, false, UnescapeRule::NONE, NULL, NULL, NULL); |
201 false, UnescapeRule::NONE, NULL, NULL); | |
202 return WideToUTF8(formatted); | 201 return WideToUTF8(formatted); |
203 } | 202 } |
204 | 203 |
205 void UrlPickerDialogGtk::SetColumnValues(int row, GtkTreeIter* iter) { | 204 void UrlPickerDialogGtk::SetColumnValues(int row, GtkTreeIter* iter) { |
206 SkBitmap bitmap = url_table_model_->GetIcon(row); | 205 SkBitmap bitmap = url_table_model_->GetIcon(row); |
207 GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(&bitmap); | 206 GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(&bitmap); |
208 std::wstring title = url_table_model_->GetText(row, IDS_ASI_PAGE_COLUMN); | 207 std::wstring title = url_table_model_->GetText(row, IDS_ASI_PAGE_COLUMN); |
209 std::wstring url = url_table_model_->GetText(row, IDS_ASI_URL_COLUMN); | 208 std::wstring url = url_table_model_->GetText(row, IDS_ASI_URL_COLUMN); |
210 gtk_list_store_set(history_list_store_, iter, | 209 gtk_list_store_set(history_list_store_, iter, |
211 COL_FAVICON, pixbuf, | 210 COL_FAVICON, pixbuf, |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 window->AddURL(); | 273 window->AddURL(); |
275 } | 274 } |
276 gtk_widget_destroy(window->dialog_); | 275 gtk_widget_destroy(window->dialog_); |
277 } | 276 } |
278 | 277 |
279 // static | 278 // static |
280 void UrlPickerDialogGtk::OnWindowDestroy(GtkWidget* widget, | 279 void UrlPickerDialogGtk::OnWindowDestroy(GtkWidget* widget, |
281 UrlPickerDialogGtk* window) { | 280 UrlPickerDialogGtk* window) { |
282 MessageLoop::current()->DeleteSoon(FROM_HERE, window); | 281 MessageLoop::current()->DeleteSoon(FROM_HERE, window); |
283 } | 282 } |
OLD | NEW |