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

Unified Diff: chrome/browser/ui/views/edit_search_engine_dialog.cc

Issue 9965143: Revert 130431 - Move the URL string from TemplateURLRef onto the owning TemplateURL. This will mak… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/edit_search_engine_dialog.cc
===================================================================
--- chrome/browser/ui/views/edit_search_engine_dialog.cc (revision 130565)
+++ chrome/browser/ui/views/edit_search_engine_dialog.cc (working copy)
@@ -28,6 +28,14 @@
using views::Textfield;
+namespace {
+// Converts a URL as understood by TemplateURL to one appropriate for display
+// to the user.
+string16 GetDisplayURL(const TemplateURL& turl) {
+ return turl.url() ? turl.url()->DisplayURL() : string16();
+}
+} // namespace
+
namespace browser {
void EditSearchEngine(gfx::NativeWindow parent,
@@ -121,8 +129,8 @@
title_tf_ = CreateTextfield(controller_->template_url()->short_name(),
false);
keyword_tf_ = CreateTextfield(controller_->template_url()->keyword(), true);
- url_tf_ = CreateTextfield(
- controller_->template_url()->url_ref().DisplayURL(), false);
+ url_tf_ = CreateTextfield(GetDisplayURL(*controller_->template_url()),
+ false);
// We don't allow users to edit prepopulate URLs. This is done as
// occasionally we need to update the URL of prepopulated TemplateURLs.
url_tf_->SetReadOnly(controller_->template_url()->prepopulate_id() != 0);
« no previous file with comments | « chrome/browser/ui/search_engines/template_url_table_model.cc ('k') | chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698