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

Side by Side Diff: chrome/browser/ui/webui/options2/search_engine_manager_handler2.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, 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
Property Changes:
Deleted: svn:mergeinfo
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/webui/options2/search_engine_manager_handler2.h" 5 #include "chrome/browser/ui/webui/options2/search_engine_manager_handler2.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 int index, bool is_default) { 189 int index, bool is_default) {
190 TemplateURLTableModel* table_model = list_controller_->table_model(); 190 TemplateURLTableModel* table_model = list_controller_->table_model();
191 const TemplateURL* template_url = list_controller_->GetTemplateURL(index); 191 const TemplateURL* template_url = list_controller_->GetTemplateURL(index);
192 192
193 base::DictionaryValue* dict = new base::DictionaryValue(); 193 base::DictionaryValue* dict = new base::DictionaryValue();
194 dict->SetString("name", template_url->short_name()); 194 dict->SetString("name", template_url->short_name());
195 dict->SetString("displayName", table_model->GetText( 195 dict->SetString("displayName", table_model->GetText(
196 index, IDS_SEARCH_ENGINES_EDITOR_DESCRIPTION_COLUMN)); 196 index, IDS_SEARCH_ENGINES_EDITOR_DESCRIPTION_COLUMN));
197 dict->SetString("keyword", table_model->GetText( 197 dict->SetString("keyword", table_model->GetText(
198 index, IDS_SEARCH_ENGINES_EDITOR_KEYWORD_COLUMN)); 198 index, IDS_SEARCH_ENGINES_EDITOR_KEYWORD_COLUMN));
199 dict->SetString("url", template_url->url_ref().DisplayURL()); 199 dict->SetString("url", template_url->url()->DisplayURL());
200 dict->SetBoolean("urlLocked", template_url->prepopulate_id() > 0); 200 dict->SetBoolean("urlLocked", template_url->prepopulate_id() > 0);
201 GURL icon_url = template_url->favicon_url(); 201 GURL icon_url = template_url->favicon_url();
202 if (icon_url.is_valid()) 202 if (icon_url.is_valid())
203 dict->SetString("iconURL", icon_url.spec()); 203 dict->SetString("iconURL", icon_url.spec());
204 dict->SetString("modelIndex", base::IntToString(index)); 204 dict->SetString("modelIndex", base::IntToString(index));
205 205
206 if (list_controller_->CanRemove(template_url)) 206 if (list_controller_->CanRemove(template_url))
207 dict->SetString("canBeRemoved", "1"); 207 dict->SetString("canBeRemoved", "1");
208 if (list_controller_->CanMakeDefault(template_url)) 208 if (list_controller_->CanMakeDefault(template_url))
209 dict->SetString("canBeDefault", "1"); 209 dict->SetString("canBeDefault", "1");
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 if (!args->GetString(ENGINE_NAME, &name) || 314 if (!args->GetString(ENGINE_NAME, &name) ||
315 !args->GetString(ENGINE_KEYWORD, &keyword) || 315 !args->GetString(ENGINE_KEYWORD, &keyword) ||
316 !args->GetString(ENGINE_URL, &url)) { 316 !args->GetString(ENGINE_URL, &url)) {
317 NOTREACHED(); 317 NOTREACHED();
318 return; 318 return;
319 } 319 }
320 edit_controller_->AcceptAddOrEdit(name, keyword, url); 320 edit_controller_->AcceptAddOrEdit(name, keyword, url);
321 } 321 }
322 322
323 } // namespace options2 323 } // namespace options2
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc ('k') | chrome/browser/webdata/keyword_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698