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

Side by Side Diff: extensions/renderer/i18n_custom_bindings.cc

Issue 1227413007: Move ReplaceStringPlaceholders to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@join
Patch Set: Created 5 years, 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/renderer/i18n_custom_bindings.h" 5 #include "extensions/renderer/i18n_custom_bindings.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "content/public/renderer/render_frame.h" 8 #include "content/public/renderer/render_frame.h"
9 #include "content/public/renderer/render_thread.h" 9 #include "content/public/renderer/render_thread.h"
10 #include "extensions/common/extension_messages.h" 10 #include "extensions/common/extension_messages.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 substitutions.push_back(*v8::String::Utf8Value(placeholders->Get( 74 substitutions.push_back(*v8::String::Utf8Value(placeholders->Get(
75 v8::Integer::New(isolate, i)))); 75 v8::Integer::New(isolate, i))));
76 } 76 }
77 } else if (args[1]->IsString()) { 77 } else if (args[1]->IsString()) {
78 // chrome.i18n.getMessage("message_name", "one param"); 78 // chrome.i18n.getMessage("message_name", "one param");
79 substitutions.push_back(*v8::String::Utf8Value(args[1])); 79 substitutions.push_back(*v8::String::Utf8Value(args[1]));
80 } 80 }
81 81
82 args.GetReturnValue().Set(v8::String::NewFromUtf8( 82 args.GetReturnValue().Set(v8::String::NewFromUtf8(
83 isolate, 83 isolate,
84 ReplaceStringPlaceholders(message, substitutions, NULL).c_str())); 84 base::ReplaceStringPlaceholders(message, substitutions, NULL).c_str()));
85 } 85 }
86 86
87 void I18NCustomBindings::GetL10nUILanguage( 87 void I18NCustomBindings::GetL10nUILanguage(
88 const v8::FunctionCallbackInfo<v8::Value>& args) { 88 const v8::FunctionCallbackInfo<v8::Value>& args) {
89 args.GetReturnValue().Set(v8::String::NewFromUtf8( 89 args.GetReturnValue().Set(v8::String::NewFromUtf8(
90 args.GetIsolate(), content::RenderThread::Get()->GetLocale().c_str())); 90 args.GetIsolate(), content::RenderThread::Get()->GetLocale().c_str()));
91 } 91 }
92 92
93 } // namespace extensions 93 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/bluetooth/bluetooth_private_api.cc ('k') | ios/web/webui/shared_resources_data_source_ios.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698