OLD | NEW |
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 "extensions/renderer/app_window_custom_bindings.h" | 5 #include "extensions/renderer/app_window_custom_bindings.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "content/public/child/v8_value_converter.h" | 8 #include "content/public/child/v8_value_converter.h" |
9 #include "content/public/renderer/render_frame.h" | 9 #include "content/public/renderer/render_frame.h" |
10 #include "content/public/renderer/render_thread.h" | 10 #include "content/public/renderer/render_thread.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 const v8::FunctionCallbackInfo<v8::Value>& args) { | 65 const v8::FunctionCallbackInfo<v8::Value>& args) { |
66 CHECK_EQ(args.Length(), 0); | 66 CHECK_EQ(args.Length(), 0); |
67 | 67 |
68 v8::Local<v8::Value> result = v8::String::Empty(args.GetIsolate()); | 68 v8::Local<v8::Value> result = v8::String::Empty(args.GetIsolate()); |
69 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 69 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
70 switches::kEnableAppWindowControls)) { | 70 switches::kEnableAppWindowControls)) { |
71 base::StringValue value( | 71 base::StringValue value( |
72 ResourceBundle::GetSharedInstance() | 72 ResourceBundle::GetSharedInstance() |
73 .GetRawDataResource(IDR_WINDOW_CONTROLS_TEMPLATE_HTML) | 73 .GetRawDataResource(IDR_WINDOW_CONTROLS_TEMPLATE_HTML) |
74 .as_string()); | 74 .as_string()); |
75 scoped_ptr<content::V8ValueConverter> converter( | 75 std::unique_ptr<content::V8ValueConverter> converter( |
76 content::V8ValueConverter::create()); | 76 content::V8ValueConverter::create()); |
77 result = converter->ToV8Value(&value, context()->v8_context()); | 77 result = converter->ToV8Value(&value, context()->v8_context()); |
78 } | 78 } |
79 args.GetReturnValue().Set(result); | 79 args.GetReturnValue().Set(result); |
80 } | 80 } |
81 | 81 |
82 } // namespace extensions | 82 } // namespace extensions |
OLD | NEW |