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

Side by Side Diff: chrome/browser/views/url_picker.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
« no previous file with comments | « chrome/browser/views/bookmark_editor_view.cc ('k') | net/base/net_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/views/url_picker.h" 5 #include "chrome/browser/views/url_picker.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "app/table_model.h" 9 #include "app/table_model.h"
10 #include "app/table_model_observer.h" 10 #include "app/table_model_observer.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 } 214 }
215 } 215 }
216 return true; 216 return true;
217 } 217 }
218 218
219 void UrlPicker::OnSelectionChanged() { 219 void UrlPicker::OnSelectionChanged() {
220 int selection = url_table_->FirstSelectedRow(); 220 int selection = url_table_->FirstSelectedRow();
221 if (selection >= 0 && selection < url_table_model_->RowCount()) { 221 if (selection >= 0 && selection < url_table_model_->RowCount()) {
222 std::wstring languages = 222 std::wstring languages =
223 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages); 223 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages);
224 // Because the url_field_ is user-editable, we set the URL with 224 // Because the url_field_ is user-editable, we don't strip anything.
225 // username:password and escaped path and query.
226 std::wstring formatted = net::FormatUrl(url_table_model_->GetURL(selection), 225 std::wstring formatted = net::FormatUrl(url_table_model_->GetURL(selection),
227 languages, false, UnescapeRule::NONE, NULL, NULL, NULL); 226 languages, net::kFormatUrlOmitNothing, UnescapeRule::NONE, NULL, NULL,
227 NULL);
228 url_field_->SetText(formatted); 228 url_field_->SetText(formatted);
229 GetDialogClientView()->UpdateDialogButtons(); 229 GetDialogClientView()->UpdateDialogButtons();
230 } 230 }
231 } 231 }
232 232
233 void UrlPicker::OnDoubleClick() { 233 void UrlPicker::OnDoubleClick() {
234 int selection = url_table_->FirstSelectedRow(); 234 int selection = url_table_->FirstSelectedRow();
235 if (selection >= 0 && selection < url_table_model_->RowCount()) { 235 if (selection >= 0 && selection < url_table_model_->RowCount()) {
236 OnSelectionChanged(); 236 OnSelectionChanged();
237 PerformModelChange(); 237 PerformModelChange();
238 if (window()) 238 if (window())
239 window()->Close(); 239 window()->Close();
240 } 240 }
241 } 241 }
242 242
243 GURL UrlPicker::GetInputURL() const { 243 GURL UrlPicker::GetInputURL() const {
244 return GURL(URLFixerUpper::FixupURL(UTF16ToUTF8(url_field_->text()), 244 return GURL(URLFixerUpper::FixupURL(UTF16ToUTF8(url_field_->text()),
245 std::string())); 245 std::string()));
246 } 246 }
OLDNEW
« no previous file with comments | « chrome/browser/views/bookmark_editor_view.cc ('k') | net/base/net_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698