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

Side by Side Diff: chrome/renderer/extensions/app_window_custom_bindings.cc

Issue 372103006: Stamp out CreateStringValue in chrome/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/webui/version_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/renderer/extensions/app_window_custom_bindings.h" 5 #include "chrome/renderer/extensions/app_window_custom_bindings.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "chrome/common/chrome_switches.h" 10 #include "chrome/common/chrome_switches.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 args.GetReturnValue().Set(window); 110 args.GetReturnValue().Set(window);
111 } 111 }
112 112
113 void AppWindowCustomBindings::GetWindowControlsHtmlTemplate( 113 void AppWindowCustomBindings::GetWindowControlsHtmlTemplate(
114 const v8::FunctionCallbackInfo<v8::Value>& args) { 114 const v8::FunctionCallbackInfo<v8::Value>& args) {
115 CHECK_EQ(args.Length(), 0); 115 CHECK_EQ(args.Length(), 0);
116 116
117 v8::Handle<v8::Value> result = v8::String::Empty(args.GetIsolate()); 117 v8::Handle<v8::Value> result = v8::String::Empty(args.GetIsolate());
118 if (CommandLine::ForCurrentProcess()->HasSwitch( 118 if (CommandLine::ForCurrentProcess()->HasSwitch(
119 switches::kEnableAppWindowControls)) { 119 switches::kEnableAppWindowControls)) {
120 base::Value* value = base::Value::CreateStringValue( 120 base::StringValue value(
Evan Stade 2014/07/08 01:22:33 this was leaking
121 ResourceBundle::GetSharedInstance().GetRawDataResource( 121 ResourceBundle::GetSharedInstance()
122 IDR_WINDOW_CONTROLS_TEMPLATE_HTML).as_string()); 122 .GetRawDataResource(IDR_WINDOW_CONTROLS_TEMPLATE_HTML)
123 .as_string());
123 scoped_ptr<content::V8ValueConverter> converter( 124 scoped_ptr<content::V8ValueConverter> converter(
124 content::V8ValueConverter::create()); 125 content::V8ValueConverter::create());
125 result = converter->ToV8Value(value, context()->v8_context()); 126 result = converter->ToV8Value(&value, context()->v8_context());
126 } 127 }
127 args.GetReturnValue().Set(result); 128 args.GetReturnValue().Set(result);
128 } 129 }
129 130
130 } // namespace extensions 131 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/version_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698