| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "content/public/child/v8_value_converter.h" | 10 #include "content/public/child/v8_value_converter.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 new ExtensionHostMsg_ResumeRequests(view->GetRoutingID())); | 103 new ExtensionHostMsg_ResumeRequests(view->GetRoutingID())); |
| 104 | 104 |
| 105 v8::Local<v8::Value> window = frame->mainWorldScriptContext()->Global(); | 105 v8::Local<v8::Value> window = frame->mainWorldScriptContext()->Global(); |
| 106 args.GetReturnValue().Set(window); | 106 args.GetReturnValue().Set(window); |
| 107 } | 107 } |
| 108 | 108 |
| 109 void AppWindowCustomBindings::GetWindowControlsHtmlTemplate( | 109 void AppWindowCustomBindings::GetWindowControlsHtmlTemplate( |
| 110 const v8::FunctionCallbackInfo<v8::Value>& args) { | 110 const v8::FunctionCallbackInfo<v8::Value>& args) { |
| 111 CHECK_EQ(args.Length(), 0); | 111 CHECK_EQ(args.Length(), 0); |
| 112 | 112 |
| 113 v8::Handle<v8::Value> result = v8::String::Empty(args.GetIsolate()); | 113 v8::Local<v8::Value> result = v8::String::Empty(args.GetIsolate()); |
| 114 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 114 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 115 switches::kEnableAppWindowControls)) { | 115 switches::kEnableAppWindowControls)) { |
| 116 base::StringValue value( | 116 base::StringValue value( |
| 117 ResourceBundle::GetSharedInstance() | 117 ResourceBundle::GetSharedInstance() |
| 118 .GetRawDataResource(IDR_WINDOW_CONTROLS_TEMPLATE_HTML) | 118 .GetRawDataResource(IDR_WINDOW_CONTROLS_TEMPLATE_HTML) |
| 119 .as_string()); | 119 .as_string()); |
| 120 scoped_ptr<content::V8ValueConverter> converter( | 120 scoped_ptr<content::V8ValueConverter> converter( |
| 121 content::V8ValueConverter::create()); | 121 content::V8ValueConverter::create()); |
| 122 result = converter->ToV8Value(&value, context()->v8_context()); | 122 result = converter->ToV8Value(&value, context()->v8_context()); |
| 123 } | 123 } |
| 124 args.GetReturnValue().Set(result); | 124 args.GetReturnValue().Set(result); |
| 125 } | 125 } |
| 126 | 126 |
| 127 } // namespace extensions | 127 } // namespace extensions |
| OLD | NEW |