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

Side by Side Diff: chrome/browser/dom_ui/options/search_engine_manager_handler.cc

Issue 6291003: Revert 71485 - Remove wstring from TemplateURL and friends.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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) 2011 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/dom_ui/options/search_engine_manager_handler.h" 5 #include "chrome/browser/dom_ui/options/search_engine_manager_handler.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
11 #include "base/values.h" 11 #include "base/values.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 DictionaryValue* SearchEngineManagerHandler::CreateDictionaryForEngine( 151 DictionaryValue* SearchEngineManagerHandler::CreateDictionaryForEngine(
152 int index, bool is_default) { 152 int index, bool is_default) {
153 TemplateURLTableModel* table_model = list_controller_->table_model(); 153 TemplateURLTableModel* table_model = list_controller_->table_model();
154 154
155 DictionaryValue* dict = new DictionaryValue(); 155 DictionaryValue* dict = new DictionaryValue();
156 dict->SetString("name", table_model->GetText( 156 dict->SetString("name", table_model->GetText(
157 index, IDS_SEARCH_ENGINES_EDITOR_DESCRIPTION_COLUMN)); 157 index, IDS_SEARCH_ENGINES_EDITOR_DESCRIPTION_COLUMN));
158 dict->SetString("keyword", table_model->GetText( 158 dict->SetString("keyword", table_model->GetText(
159 index, IDS_SEARCH_ENGINES_EDITOR_KEYWORD_COLUMN)); 159 index, IDS_SEARCH_ENGINES_EDITOR_KEYWORD_COLUMN));
160 const TemplateURL* template_url = list_controller_->GetTemplateURL(index); 160 const TemplateURL* template_url = list_controller_->GetTemplateURL(index);
161 dict->SetString("url", template_url->url()->DisplayURL()); 161 dict->SetString("url", WideToUTF16Hack(template_url->url()->DisplayURL()));
162 dict->SetBoolean("urlLocked", template_url->prepopulate_id() > 0); 162 dict->SetBoolean("urlLocked", template_url->prepopulate_id() > 0);
163 GURL icon_url = template_url->GetFavIconURL(); 163 GURL icon_url = template_url->GetFavIconURL();
164 if (icon_url.is_valid()) 164 if (icon_url.is_valid())
165 dict->SetString("iconURL", icon_url.spec()); 165 dict->SetString("iconURL", icon_url.spec());
166 dict->SetString("modelIndex", base::IntToString(index)); 166 dict->SetString("modelIndex", base::IntToString(index));
167 167
168 if (list_controller_->CanRemove(template_url)) 168 if (list_controller_->CanRemove(template_url))
169 dict->SetString("canBeRemoved", "1"); 169 dict->SetString("canBeRemoved", "1");
170 if (list_controller_->CanMakeDefault(template_url)) 170 if (list_controller_->CanMakeDefault(template_url))
171 dict->SetString("canBeDefault", "1"); 171 dict->SetString("canBeDefault", "1");
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 string16 keyword; 270 string16 keyword;
271 std::string url; 271 std::string url;
272 if (!args->GetString(ENGINE_NAME, &name) || 272 if (!args->GetString(ENGINE_NAME, &name) ||
273 !args->GetString(ENGINE_KEYWORD, &keyword) || 273 !args->GetString(ENGINE_KEYWORD, &keyword) ||
274 !args->GetString(ENGINE_URL, &url)) { 274 !args->GetString(ENGINE_URL, &url)) {
275 NOTREACHED(); 275 NOTREACHED();
276 return; 276 return;
277 } 277 }
278 edit_controller_->AcceptAddOrEdit(name, keyword, url); 278 edit_controller_->AcceptAddOrEdit(name, keyword, url);
279 } 279 }
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/options/browser_options_handler.cc ('k') | chrome/browser/extensions/extension_omnibox_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698