Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Side by Side Diff: chrome/browser/gtk/options/url_picker_dialog_gtk.cc

Issue 1513023: Strips http from omnibox (and a couple of other places) (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <gtk/gtk.h> 5 #include <gtk/gtk.h>
6 6
7 #include "app/gtk_util.h" 7 #include "app/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 "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 gint row = gtk_tree::GetTreeSortChildRowNumForPath(history_list_sort_, path); 191 gint row = gtk_tree::GetTreeSortChildRowNumForPath(history_list_sort_, path);
192 if (row < 0) { 192 if (row < 0) {
193 NOTREACHED(); 193 NOTREACHED();
194 return std::string(); 194 return std::string();
195 } 195 }
196 std::wstring languages = 196 std::wstring languages =
197 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages); 197 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages);
198 // Because the url_field_ is user-editable, we set the URL with 198 // Because the url_field_ is user-editable, we set the URL with
199 // username:password and escaped path and query. 199 // username:password and escaped path and query.
200 std::wstring formatted = net::FormatUrl(url_table_model_->GetURL(row), 200 std::wstring formatted = net::FormatUrl(url_table_model_->GetURL(row),
201 languages, false, UnescapeRule::NONE, NULL, NULL, NULL); 201 languages, net::kFormatUrlOmitNothing, UnescapeRule::NONE, NULL, NULL,
202 NULL);
202 return WideToUTF8(formatted); 203 return WideToUTF8(formatted);
203 } 204 }
204 205
205 void UrlPickerDialogGtk::SetColumnValues(int row, GtkTreeIter* iter) { 206 void UrlPickerDialogGtk::SetColumnValues(int row, GtkTreeIter* iter) {
206 SkBitmap bitmap = url_table_model_->GetIcon(row); 207 SkBitmap bitmap = url_table_model_->GetIcon(row);
207 GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(&bitmap); 208 GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(&bitmap);
208 std::wstring title = url_table_model_->GetText(row, IDS_ASI_PAGE_COLUMN); 209 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); 210 std::wstring url = url_table_model_->GetText(row, IDS_ASI_URL_COLUMN);
210 gtk_list_store_set(history_list_store_, iter, 211 gtk_list_store_set(history_list_store_, iter,
211 COL_FAVICON, pixbuf, 212 COL_FAVICON, pixbuf,
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 267
267 void UrlPickerDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { 268 void UrlPickerDialogGtk::OnResponse(GtkWidget* dialog, int response_id) {
268 if (response_id == GTK_RESPONSE_OK) 269 if (response_id == GTK_RESPONSE_OK)
269 AddURL(); 270 AddURL();
270 gtk_widget_destroy(dialog_); 271 gtk_widget_destroy(dialog_);
271 } 272 }
272 273
273 void UrlPickerDialogGtk::OnWindowDestroy(GtkWidget* widget) { 274 void UrlPickerDialogGtk::OnWindowDestroy(GtkWidget* widget) {
274 MessageLoop::current()->DeleteSoon(FROM_HERE, this); 275 MessageLoop::current()->DeleteSoon(FROM_HERE, this);
275 } 276 }
OLDNEW
« no previous file with comments | « chrome/browser/gtk/options/passwords_page_gtk.cc ('k') | chrome/browser/net/browser_url_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698