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

Side by Side Diff: chrome/browser/ui/webui/options/core_options_handler.cc

Issue 176843022: Move UTF16ToASCII, remove WideToASCII. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
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/options/core_options_handler.h" 5 #include "chrome/browser/ui/webui/options/core_options_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 429
430 if (!list_member->IsType(base::Value::TYPE_STRING)) 430 if (!list_member->IsType(base::Value::TYPE_STRING))
431 continue; 431 continue;
432 432
433 std::string pref_name; 433 std::string pref_name;
434 if (!list_member->GetAsString(&pref_name)) 434 if (!list_member->GetAsString(&pref_name))
435 continue; 435 continue;
436 436
437 result_value.Set(pref_name.c_str(), FetchPref(pref_name)); 437 result_value.Set(pref_name.c_str(), FetchPref(pref_name));
438 } 438 }
439 web_ui()->CallJavascriptFunction(UTF16ToASCII(callback_function), 439 web_ui()->CallJavascriptFunction(base::UTF16ToASCII(callback_function),
440 result_value); 440 result_value);
441 } 441 }
442 442
443 void CoreOptionsHandler::HandleObservePrefs(const base::ListValue* args) { 443 void CoreOptionsHandler::HandleObservePrefs(const base::ListValue* args) {
444 // First param is name is JS callback function name, the rest are pref 444 // First param is name is JS callback function name, the rest are pref
445 // identifiers that we are observing. 445 // identifiers that we are observing.
446 DCHECK_GE(static_cast<int>(args->GetSize()), 2); 446 DCHECK_GE(static_cast<int>(args->GetSize()), 2);
447 447
448 // Get preference change callback function name. 448 // Get preference change callback function name.
449 std::string callback_func_name; 449 std::string callback_func_name;
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 } 619 }
620 620
621 void CoreOptionsHandler::UpdatePepperFlashSettingsEnabled() { 621 void CoreOptionsHandler::UpdatePepperFlashSettingsEnabled() {
622 base::FundamentalValue enabled( 622 base::FundamentalValue enabled(
623 plugin_status_pref_setter_.IsPepperFlashSettingsEnabled()); 623 plugin_status_pref_setter_.IsPepperFlashSettingsEnabled());
624 web_ui()->CallJavascriptFunction( 624 web_ui()->CallJavascriptFunction(
625 "OptionsPage.setPepperFlashSettingsEnabled", enabled); 625 "OptionsPage.setPepperFlashSettingsEnabled", enabled);
626 } 626 }
627 627
628 } // namespace options 628 } // namespace options
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698