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

Side by Side Diff: chrome/browser/dom_ui/options/browser_options_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/browser_options_handler.h" 5 #include "chrome/browser/dom_ui/options/browser_options_handler.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/scoped_ptr.h" 9 #include "base/scoped_ptr.h"
10 #include "base/singleton.h" 10 #include "base/singleton.h"
11 #include "base/string_number_conversions.h" 11 #include "base/string_number_conversions.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 222
223 int default_index = 0; 223 int default_index = 0;
224 ListValue search_engines; 224 ListValue search_engines;
225 std::vector<const TemplateURL*> model_urls = 225 std::vector<const TemplateURL*> model_urls =
226 template_url_model_->GetTemplateURLs(); 226 template_url_model_->GetTemplateURLs();
227 for (size_t i = 0; i < model_urls.size(); ++i) { 227 for (size_t i = 0; i < model_urls.size(); ++i) {
228 if (!model_urls[i]->ShowInDefaultList()) 228 if (!model_urls[i]->ShowInDefaultList())
229 continue; 229 continue;
230 230
231 DictionaryValue* entry = new DictionaryValue(); 231 DictionaryValue* entry = new DictionaryValue();
232 entry->SetString("name", model_urls[i]->short_name()); 232 entry->SetString("name", WideToUTF16Hack(model_urls[i]->short_name()));
233 entry->SetInteger("index", i); 233 entry->SetInteger("index", i);
234 search_engines.Append(entry); 234 search_engines.Append(entry);
235 if (model_urls[i] == default_url) 235 if (model_urls[i] == default_url)
236 default_index = i; 236 default_index = i;
237 } 237 }
238 238
239 scoped_ptr<Value> default_value(Value::CreateIntegerValue(default_index)); 239 scoped_ptr<Value> default_value(Value::CreateIntegerValue(default_index));
240 240
241 dom_ui_->CallJavascriptFunction(L"BrowserOptions.updateSearchEngines", 241 dom_ui_->CallJavascriptFunction(L"BrowserOptions.updateSearchEngines",
242 search_engines, *(default_value.get())); 242 search_engines, *(default_value.get()));
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 } 377 }
378 378
379 void BrowserOptionsHandler::SaveStartupPagesPref() { 379 void BrowserOptionsHandler::SaveStartupPagesPref() {
380 PrefService* prefs = dom_ui_->GetProfile()->GetPrefs(); 380 PrefService* prefs = dom_ui_->GetProfile()->GetPrefs();
381 381
382 SessionStartupPref pref = SessionStartupPref::GetStartupPref(prefs); 382 SessionStartupPref pref = SessionStartupPref::GetStartupPref(prefs);
383 pref.urls = startup_custom_pages_table_model_->GetURLs(); 383 pref.urls = startup_custom_pages_table_model_->GetURLs();
384 384
385 SessionStartupPref::SetStartupPref(prefs, pref); 385 SessionStartupPref::SetStartupPref(prefs, pref);
386 } 386 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698